Thomas -
Currently the database logging feature stores the active session to the database in a variable attached to the execution. The sharing of the session is based on the schema name. So if we can change the schema name and the connection string prior to logging the data, the alternate database should be used.
If you are using post UUR logging (not on the fly) the following with TS 3.1 appears to work. My default connection string is:
Provider=Microsoft.Jet.OLEDB.4.0;
Data Source=D:\Perforce\3.5\App\TestStand\Components\NI\Models\TestStandModels\Database\database0.mdb;
Persist Security Info=False
Change "Parameters.DatabaseOptions" from "pass by ref" to "pass by value" in the "Log to Database" sequence of "Database.seq", so that edits to the database options are not shared with other sockets.
Add a statement step to the top of the sequence to append a socket number at the end of the database name and the schema name.
StepType, Adapter: Statement,
Description:
Parameters.DatabaseOptions.ConnectionString =
SearchAndReplace(Parameters.DatabaseOptions.ConnectionString,
"database.mdb", "database" + Str(Parameters.UUT.TestSocketIndex)
+ ".mdb"),
Parameters.DatabaseOptions.DatabaseSchema.Name +=
Str(Parameters.UUT.TestSocketIndex)
Flow Properties:
Precondition:
Parameters.UUT.TestSocketIndex > -1
If you are doing on the fly logging, you could do the following, in the sequence "Single Pass -- Test Socket Entry Point" in ParallelModel.seq
1) Add a new Locals.DatabaseOptions variable.
2) Edit the Step: "New UUT for Database Logging" by adding a preexpression as shown below and pass
Locals.DatabaseOptions instead to the call:
StepType, Adapter: Action, ActiveX/COM
Description:
Action, Call ITSDBLog{Locals.DBLogRef}.NewUUT (ThisContext,
Parameters.TestSocket.UUT, Locals.DatabaseOptions,
Parameters.TestSocket.StartTime, Parameters.TestSocket.StartDate,
Parameters.ModelData.StationInfo)
Flow Properties:
Precondition:
!(Locals.DBLogRef == Nothing)
Pre Expression:
Locals.DatabaseOptions = Parameters.ModelData.DatabaseOptions,
Locals.DatabaseOptions.ConnectionString =
SearchAndReplace(Locals.DatabaseOptions.ConnectionString,
"database.mdb", "database" + Str(RunState.TestSockets.MyIndex) +
".mdb"),
Locals.DatabaseOptions.DatabaseSchema.Name +=
Str(RunState.TestSockets.MyIndex)
Make a similar change to the Test UUTs socket entry point.
This should work for you...
Message Edited by Scott Richardson (NI) on 05-03-2005 11:39 AM
Scott Richardson