Problems with an automated Vault client
Posted: Tue Jun 10, 2008 6:13 am
Hi,
I've been working on an automated service to do our internal builds. It is a simple custom build web service that gets the source from Vault first via API and then executes the tasks in turn.
The version of Vault I am using is v4.1.2. I am having concurrency problems: the web service sets a label first and then gets the source into a local subdirectory using:
The problem is when this code executes concurrently (i.e. trying to get another label locally at the same time), the second thread throws an exception:
I am looking at the way web service handles the connections to Vault as the possible reason. At the moment, before executing a task, the service does this:
So the two concurrent threads will share the same connection right? So calling ProcessCommandGetLabelToLocationOutsideWorkingFolder() concurrently on the same connection does not work.
How else can I do it? How would you recommend handling Vault connections generally? Maintain a pool and allocate to each thread? What is the most optimal way to do it for me (performance etc)?
Also, what do "bAllowAuto", "bSaveSession" parameters mean in the call to Login? What are their defaults (in Login())? Also, can you explain what VaultConnection.AccessLevelType options mean, especially when used in a web service?
Thanks a lot.
I've been working on an automated service to do our internal builds. It is a simple custom build web service that gets the source from Vault first via API and then executes the tasks in turn.
The version of Vault I am using is v4.1.2. I am having concurrency problems: the web service sets a label first and then gets the source into a local subdirectory using:
Code: Select all
GetOperations.ProcessCommandGetLabelToLocationOutsideWorkingFolder(vaultFolderPath, labelName, Nothing, getOptions, localFolderPath)
Code: Select all
VaultClientOperationsLib.GetLatestVersionFailedException: Exception of type 'VaultClientOperationsLib.GetLatestVersionFailedException' was thrown.
at VaultClientOperationsLib.ClientInstance.ProcessGetFileRequests(GetFileInfo[] infos, MakeWritableType makeWritable, SetFileTimeType setFileTime, MergeType merge, Boolean updateHiddenFilesOnly, String ancestorFullPath, Boolean flat, String ancestorDiskPath, OverwritePrompt PromptData, Boolean isLabelGet, String currentPathToLabelItem, Int64 labelID, Boolean isRetry, Boolean isGetByDisplayVersion)
at VaultClientOperationsLib.ClientInstance.GetByLabelToNonWorkingFolder_GetData(VaultClientFile[] files, Boolean overwrite, MakeWritableType makeWritable, SetFileTimeType setFileTime, String ancestorFullPath, String ancestorDiskPath, OverwritePrompt PromptData, Int64 labelID, String currentPathToLabelItem, String labelSubItemPath, Boolean isLabelGetForSingleFile)
at VaultClientOperationsLib.ClientInstance.GetByLabelToNonWorkingFolder_GetData(VaultClientFolder folder, Boolean recursive, Boolean overwrite, MakeWritableType makeWritable, SetFileTimeType setFileTime, String destinationDiskPath, OverwritePrompt PromptData, Int64 labelID, String currentPathToLabelItem, String labelSubItemPath)
at VaultClientIntegrationLib.GetOperations.performLabelGet(String objectPath, String label, String labelSubItem, String labelWorkingFolder, String destPath, GetOptions go)
at VaultClientIntegrationLib.GetOperations.ProcessCommandGetLabelToLocationOutsideWorkingFolder(String objectPath, String label, String labelSubItem, GetOptions getOptions, String destPath)
Code: Select all
If (Not ServerOperations.isConnected) Then
ServerOperations.client.LoginOptions.URL = ...
ServerOperations.client.LoginOptions.User = ...
ServerOperations.client.LoginOptions.Password = ...
ServerOperations.client.LoginOptions.Repository = ...
ServerOperations.Login(VaultConnection.AccessLevelType.Client, true, true)
End If
How else can I do it? How would you recommend handling Vault connections generally? Maintain a pool and allocate to each thread? What is the most optimal way to do it for me (performance etc)?
Also, what do "bAllowAuto", "bSaveSession" parameters mean in the call to Login? What are their defaults (in Login())? Also, can you explain what VaultConnection.AccessLevelType options mean, especially when used in a web service?
Thanks a lot.