次の方法で共有


CReplicationClient.Commit Method

For the latest version of Commerce Server 2007 Help, see the Microsoft Web site.

Applies pending Commerce Server Staging (CSS) transactions on each destination server that is defined for the CSS project.

Note

This method and the CReplicationClient object are used only to stage individual files. You cannot use this method to stage projects.

void Commit()

Remarks

You must have CSS administrator or operator rights on the project to execute this method.

Use the Commit method to apply any pending replications in a session that you started by using a CReplicationClient method. For example, you can use the Commit method to commit a session where you call the Connect method to initiate the session, perform replications with the SendFile, SendFiles, or DeleteFile method, and sever the connection with the Disconnect method.

The Commit method has no effect if the CSS server is running in "connectionless" mode, that is, if you are making individual SendFile, SendFiles, and DeleteFile method calls that transparently perform the connect and disconnect operations.

The CReplicationClient.Commit method corresponds to the COM method named ReplicationClient.Commit.

Example

The following example opens a project named Project1, deletes a file, sends a file, and then commits the transactions.

CReplicationClient replicationClient = new CReplicationClient();
replicationClient.Initialize("Project1");
replicationClient.Connect();
replicationClient.DeleteFile("oldfile.htm");
replicationClient.SendFile("newfile.htm");
replicationClient.Commit();
// ...
replicationClient.Disconnect();

See Also

Other Resources

CReplicationClient.Abort Method

CReplicationClient Class