Hi,
I'm integrating Vault into my designs according to the VaultDemoStaircase example (and a potlatch episode).
'Download a file from the vault if it is not found on the local filesystem. Method UpdateFromVault( filename As String) As Boolean Dim fileExists? As Boolean = Access(filename, :Exists) Dim UseVault? As boolean=true If Not fileExists? and UseVault? Then Dim Conn Try Conn = OpenConnection() If( Conn.FileManager.FileExistsInVault(filename)) Then '%%iv_Message("Intent is downloading " + filename) conn.FileManager.DownloadLatestFile( filename) fileExists? = True End If Finally CloseConnection( Conn) End Try End If Return fileExists? End Method
I was under the assumption that the connection is being resused/cached during the entire session. But when I look with Intent Tracer in the log-files, I see multiple times that intent spent quite some time to open a new connection (up to 6sec for 2 consecutive calls).
First call
Second call
Is this normal behavior or am I doing something wrong ?
Cheers,
Mark
Solved! Go to Solution.
Solved by AlexKorzun. Go to Solution.
Hi Mark
Connection is a resource, the example is conversative to keep its low usage.
Within the same connection you can perform sequence of operations, that work on the set of files.
Example:
Method FilesExistInVault( localFileNames As List, Optional exceptionOnError? As Boolean = True) As List
Usually, the first connection to the Vault server takes a time. The consequent ones are fast. So, from your timings, I assume that download takes about two seconds. This time is determined by file size and connection speed. It should be quite similar to what you are getting with Vault client.
Alex,
Thanks for the swift reply but what am I seeing here ?
What happens here it that I place a window in a wall (named KW2). This comes down to cutting a rectangle in the wall part and place a window. When applying a cut feature, Intent has to calculate a new part but first looks in the Vault to see if that part already exists. But when it takes to long to search Vault for that file, what are the benefits of using Vault/Intent ? I tought the gain would be that Intent does not have to generate a new part but simply download it (when it exists).
First call to OpenConnection()
And the second time OpenConnection() is called :
When I look at these numbers, it seems to me that the connection is not being reused. In the trace file I do not see any indication of excessive download times but recurring connection times. Am I missing something ?
Cheers,
Mark
Hi Mark,
1. The second trace shows a chunk of time eaten by .Trace Rule. Could you please ensure that the DiagnosticMessages? Parameter is False
2. Trace does not show the timing (we filed a defect) on .Net calls, between OpenConnection and CloseConnection:
If( conn.FileManager.FileExistsInVault(filename)) Then
'%%iv_Message("Intent is downloading " + filename)
conn.FileManager.DownloadLatestFile( filename)
fileExists? = True
End If
You may consider splitting the code into the separate Rules, like below, to appear in the tracing log:
Rule fileExistsInVault? = conn.FileManager.FileExistsInVault(filename)
3. Again, what time does it take to manually download the file from Vault Server? Is the Vault Server on the local network (machine) or remote network?
Hi Mark,
We did some experiments with keeping Vault connection alive, and the staircase project is running successfully (and faster). The Intent-side changes are depicted below:
Shared Rule GlobalConnection As Any = OpenConnection()
' Download a file from the vault if it is not found on the local filesystem.
Method UpdateFromVault( filename As String) As Boolean
Dim fileExists? As Boolean = Access(filename, :Exists)
If Not fileExists? Then
Dim conn
Try
conn = GlobalConnection ' OpenConnection()
If( conn.FileManager.FileExistsInVault(filename)) Then
'%%iv_Message("Intent is downloading " + filename)
conn.FileManager.DownloadLatestFile( filename)
fileExists? = True
End If
Finally
' CloseConnection( conn)
End Try
End If
Return fileExists?
End Method
Alex,
Great job. This did the trick, defining the connection outside the method body. I even think that it's OK to close the connection so Intent kan reuse the connection.
When changing the method UpdateFromVault (using VS2010), I get following errors (not all at the same time, but one after another after consecutively saves) :
then
then
It looks like Intent does not find some references to some dll's. Nevertheless the code works, but the errors bother me.
Cheers,
Mark
Hi Mark,
Please file reproducible case with ADN (it might be hard to reproduce).
Message boxes show the dependencies with quite old version of DevExpress (with 2014 hosts we are using versions 12.1.4.0).
It could be one of the addins that references 8.1.6 version