NI TestStand

cancel
Showing results for 
Search instead for 
Did you mean: 

Use Transaction Processing - data link - DB logging

Hi
I use DB logging i TestStand (3.0) and log data to a MSSQL 2000 desktop engine.
Lately I have experienced something strange. Sometimes, when the DB is full (about 2GB) TestStand logs only UUT header info, and no step data, even though I have cheked for "Use Transaction Processing" in the datalink tab.
Shouldn't TestStand roll back the transaction operation to prevent the partial results from being logged if it fails to log all the results for a UUT?
And also, Shouldn't TestStand return an error message?
 
Regards
Tom Andres Lomsdalen, CTD
0 Kudos
Message 1 of 9
(4,807 Views)
Tom -
If the ODBC driver or the OLE-DB provider returns an error, the logging feature will return that error to you. If the transaction feature is enabled, it should then attempt to rollback the change. I have never tested any database to find out how well they behave when the size of the database is maxed out. From your description, I expect that an error is not being returned to the logging feature.
Scott Richardson
https://testeract.com
0 Kudos
Message 2 of 9
(4,794 Views)

Thank's for the reply Scott,

It seems that TestStand might have an different behavior:

While TestStand is in the process of inserting the data to the database, we have an other application retrieving data from the database. This application usually retrieves the entire test, however sometimes the data retrieved consists of UUT Header information only.

If TestStand run it's entire insertprocess in a SQL Server transaction, this should not be possible (using default readcommitted locking). This theory is strongly supported with the issue we encounter during maxed-out MSDE (2GB limit). The SQL Server log, states that Database is full, and expand is not possible and process was terminated. However the UUT Header information remains in the database, while step and measurment data is never logged.

To support our theory, we created a testapplication. This application confirmed our worries - the UUT Header is readable before step- and measurement-data gets committed. Also we ran a trace using SQL Profiler, which showed an explicit COMMIT TRAN between Header and Step/Measurement.

Can you please confirm or disprove this behaviour?

Regards
Tom Andres Lomsdalen, CTD
0 Kudos
Message 3 of 9
(4,792 Views)

Tom -

Looking at the code <TestStand>\Components\NI\Models\TestStandModels\Database\DBLog\TSDatalink.cpp in the function CTSDatalink::LogResults, it appears to be written to use a separate transaction for the UUT result and its step results. I am not sure if there was a reason for this separation. If you have MSVC you should be able to make a change and recompile it. I have written a problem on this.

As for why an error is not surfacing, I do not know. Looking at the error logic all seems fine. We would have to try to reproduce the problem to determine if an error is being returned from the database.

Also, there is another known issue with TestStand 3.0 database logging, see Do I Get Database Logging Errors While Using Parallel or Batch Model in TestStand 3.0?

Message Edited by Scott Richardson on 10-13-2006 10:54 AM

Scott Richardson
https://testeract.com
0 Kudos
Message 4 of 9
(4,771 Views)
Tom -
Can you let me know which schema are you using or based yours off of, Recordset, Insert or Stored Procedure?
Scott Richardson
https://testeract.com
0 Kudos
Message 5 of 9
(4,762 Views)

Tom -

When I used SQL Server 2005 to log results using the INSERT schema, the following error was returned when it tried to write to the database:

An error occurred calling 'LogResults' in 'ITSDBLog' of 'zNI TestStand Database Logging'
An error occurred executing a statement.
Schema: Generic Insert (NI).
Statement: STEP_RESULT.
Could not allocate space for object 'dbo.STEP_RESULT'.'PK__STEP_RESULT__7E6CC920' in database 'TestStand Insert' because the 'PRIMARY' filegroup is full. Create disk space by deleting unneeded files, dropping objects in the filegroup, adding additional files to the filegroup, or setting autogrowth on for existing files in the filegroup.
Description: Could not allocate space for object 'dbo.STEP_RESULT'.'PK__STEP_RESULT__7E6CC920' in database 'TestStand Insert' because the 'PRIMARY' filegroup is full. Create disk space by deleting unneeded files, dropping objects in the filegroup, adding additional files to the filegroup, or setting autogrowth on for existing files in the filegroup.
Number: -2147217900
NativeError: 1105
SQLState: 42000
Reported by: Microsoft SQL Native Client
Source: TSDBLog

-2147217900; User-defined error code.

Step 'Log Results to Database' of sequence 'Log To Database' in 'Database.seq'

Looking at the table results, I saw that the last UUT_RESULT record had no records for steps as you found, but the error did propagate back to TestStand.

 

Scott Richardson
https://testeract.com
0 Kudos
Message 6 of 9
(4,756 Views)

Hi Scott,

Sorry for late reply.

First: We base our schema on the "SQL Server Stored Proc (NI)" schema, but we have rewritten it. (So, we use stored procedures)
Second: I see you get error from the SQL server (and we don't). Could this be because we use stored procedures?
Also: We use MSDE 2000 desktop engine as local db client

Thanks.

Regards
Tom Andres Lomsdalen, CTD
0 Kudos
Message 7 of 9
(4,722 Views)

Tom -
I do not have MSDE 2000. I go the same error with the stored procedure schema when the SQL Server 2005 local database had reached its max size.

Scott Richardson
https://testeract.com
0 Kudos
Message 8 of 9
(4,699 Views)
Scott,
 
OK, thank you very much for your help.
Regards
Tom Andres Lomsdalen, CTD
0 Kudos
Message 9 of 9
(4,672 Views)