adburne wrote:
 
> Hi, I'm a little confused about the method to make transactions in sapdb (working 
> with autocommit; isolation level committed) trough odbc.
>  
> I've a base table with 16 records and test it trough 2 pc:
>  
> PC1) SELECT * FROM table1
> 16 rows -> ok
>  
> PC2) SELECT * FROM table1 
> 16 rows -> ok
>  
> PC1) SUBTRANS BEGIN
>  -> ok
>  
> PC1) INSERT INTO table1 (pk, desc) VALUES (17,'17')
>  -> ok
>  
> PC2) SELECT * FROM table1 
> Waiting... (There is a table lock) -> ok
>  
> PC1) SUBTRANS END
>  -> ok
>  
> PC2) SELECT * FROM table1 
> Waiting... -> That's wrong, the table must be free �?
>  
> After this, PC2 is still waiting then I make SUBTRANS END (for example) on PC1; this 
> makes an error (obviously), but PC2 now is free and there is only 16 records not 17, 
> any clue?
>  
> I'm from Argentina, my natural language is spanish, sorry if there is many spell 
> errors ;+)
>  
>  
Hi,
 
you are right, you seem to be a little bit confused:
1. if you want to use normal transactions, then no SUBTRANS... has to be used.
   The first transaction is started, when you connect, the next(s) are started, when
   the transaction before is closed with commit resp. rollback.
2. there is no TABLE LOCK for the inserted row, but a row lock (with default isolation 
level,
   unfortunately you did not tell which isolation level you used). But as the select 
wants
   to see the row, it waits for it
3. SUBTRANS END resp. SUBTRANS ROLLBACK does NOT release locks, only the
    real transaction-ends COMMIT resp. ROLLBACK release locks.
4. You did not use autocommit, right? But on the other hand I do not see, why the
    superfluous/with error SUBTRANS END should release locks (PC2 is free) if there
    was no AUTOCOMMIT set. But in that case the INSERT would have been committed, too
    and not hold locks.
    Therefore, I would like to see the vtrace of that session from connect to the last 
step
    mentioned. Please see:
http://sapdb.2scale.net/moin.cgi/VTrace <http://sapdb.2scale.net/moin.cgi/VTrace> 
It will do if there are no blanks in the RUNDIRECTORY of your database.
Otherwise do as written there, but instead of step 4 and 5 do
Then please go into the Rundirectory of your database

and do 

xkernprot -f knltrace akbm

The resulting file is what you are looking for.

 

Elke

SAP Labs Berlin

Reply via email to