Quantcast
Channel: SCN: Message List - SAP Adaptive Server Enterprise (SAP ASE) for Custom Applications
Viewing all articles
Browse latest Browse all 3587

Re: Working on same table from different session

$
0
0

It doesn't matter if these statements are in a stored procedure or not.

A stored procedure is not the same thing as a transaction.

 

The behavior depends on whether the clients are using chained mode or not.

 

If not using chained mode or explicit BEGIN TRANSACTION, each statement is an atomic transaction that takes locks, does its thing, and then releases the locks.  The second sessions truncate could occur between any two of the first sessions statements.

 

Within a transaction, the truncate table will take an exclusive table lock and hold it until the end of the transaction.  The second session won't be able to truncate the table until the first session's transaction commits and it releases its lock(s).

 

-bret


Viewing all articles
Browse latest Browse all 3587

Trending Articles