Strange situation where API stops functioning

Post your questions regarding using the Vault and Fortress API in your programs.

Moderator: SourceGear

Post Reply
cward
Posts: 2
Joined: Tue Oct 21, 2008 12:45 pm

Strange situation where API stops functioning

Post by cward » Tue Oct 21, 2008 1:37 pm

Hey guys,

To begin with, i am using the API from release 4.1.2 (18185)

I have code that calls VaultClientIntegrationLib.ServerOperations.ProcessCommandCheckout and ProcessCommandCommit.

All of the code has worked previously - now all of the sudden, the code executes, but the Checkout / Commit never occurs, and there are no exceptions thrown.


I have a older executable that runs the same code as above on the same machine , and works properly.

Any idea what would cause the ProcessCommandCheckout / Commit to appear to run sucessfully, yet not actually do anything?

shannon

Re: Strange situation where API stops functioning

Post by shannon » Wed Oct 22, 2008 7:33 am

Does it work with 4.1.3? How old is the old version it works with?

Can you post a code snippet?

cward
Posts: 2
Joined: Tue Oct 21, 2008 12:45 pm

Re: Strange situation where API stops functioning

Post by cward » Wed Oct 22, 2008 9:33 am

Here is a code snippet. This is exactly the same code the 'old version' uses, against the same vault (Ver 4.1.2), repository, user, ect. I am unable to test this on 4.1.3 unfortunately, as we are only using 4.1.2 now.
----------------

Public Sub Checkout(ByVal DatabaseName As String, ByVal SnapshotVaultFilePath As String, ByVal VaultEnvironmentToBuild As String)
Dim MyOptions As New VaultClientIntegrationLib.GetOptions
Dim PathToVaultFolder As String = "$/" & SnapshotVaultFilePath & "/"
Dim PathToSnapshots As String = "C:\Snapshots\" & VaultEnvironmentToBuild & DatabaseName
VaultClientIntegrationLib.ServerOperations.SetWorkingFolder(PathToVaultFolder, PathToSnapshots, False)

Dim CheckedOutSnapshot As String()
ReDim CheckedOutSnapshot(0)
CheckedOutSnapshot.SetValue("$/" & SnapshotVaultFilePath & "/" & DatabaseName & ".snp", 0)
VaultClientIntegrationLib.ServerOperations.ProcessCommandCheckout(CheckedOutSnapshot, True, True, MyOptions)
ServerOperations.client.ClientInstance.Refresh()
End Sub

Public Sub CheckIn(ByVal SnapshotVaultFilePath As String, ByVal CurrentEnvironment As String)

Dim ChangeSet As VaultClientOperationsLib.ChangeSetItemColl
ChangeSet = VaultClientIntegrationLib.ServerOperations.ProcessCommandListChangeSet(CheckedOutSnapshot)
ServerOperations.client.ClientInstance.Refresh()
ServerOperations.client.Comment = CurrentEnvironment & "- " & System.DateTime.Now
ServerOperations.ProcessCommandCommit(ChangeSet, UnchangedHandler.Checkin, False, VaultClientOperationsLib.LocalCopyType.Replace, False)
ServerOperations.client.ClientInstance.Refresh()
End Sub

---Again, much thanks for the help, it is very much appreciated!
-Chris

shannon

Re: Strange situation where API stops functioning

Post by shannon » Wed Oct 22, 2008 10:44 am

The 4.1.3 api is compatible with the 4.1.2 server. Do you know what version this "old" version is?

Post Reply