Skip to Content

Meaning of “Name/Userid is NULL” in sp_iqtransaction.

We can sometimes see that the Name and Userid is (NULL) in sp_iqtransaction like below.

[SQL]

  select * from sp_iqtransaction() where Name is null and userid is null ;

Name Userid TxnID CmtID VersionID State Connhandle IQConnID TxnCreateTime
(NULL) (NULL) 52458621 52458626 52458626 COMMITTED 58 2714410 2014-04-28 14:59:26.041

[Steps to reproduce]

There are two session A and B.

1. create a test table.

    – create table gjang(c1 int);

2. [Session A]

    – Data has been changed using insert command.

      >> insert gjang values(1);

3. [Session B]

    – Before commit is executed in “Session A”, Reference old version of
gjang table in “Session B”.

      >> select * from gjang;

4. [Session A]

    – Execute commit and then disconnect from “Session A”.

      >> /*insert gjang values(1);*/
      >> commit

5. We can see that Name and Userid of “Session A” is null after disconnection.

[Cause]

If “Session A” has been disconnected, Name and Userid becomes NULL. Because
“Session B” is still referencing an old version of table in “Session A.”

[Session B]

Name Userid TxnID CmtID VersionID State Connhandle IQConnID TxnCreateTime
SQL_DBC_10a18710 DBA 52458705 0 52458705 ACTIVE 57 2714356 2014-04-28 15:00:36.545

If Executing a commit after completing a referencing job in “Session B”,
State of “Session A” will be changed from COMMITTED to APPLIED.
And then “Session A” will be disappeared in sp_iqtransaction when next checkpoint.

[Session B]

>> /*select * from gjang;*/
>> commit;

Thanks

Gi-Sung Jang

4 Comments
You must be Logged on to comment or reply to a post.