RE: Sql Server, pessimist locking and transactions

"Nuno Godinho" <[email protected]>
Newsgroups gmane.comp.lang.4gl.fourjs.user
Message-ID <4EA9E2774F529143944B50BA22187F7E0A77F0@201.86.30.213.rev.vodafone.pt>
Hi. 
    I had the same problem months ago. If I recall it correctly it happens because whenever an exception ocurs when executing a SQL statement the SQL Server executes a rollback with no acknoledgement of the 4Js.
 
    I managed do solve it creating a function to begin and to end transactions. Every time it starts a transaction it increnments a counter. Every time it closes a transaction, either by rollback and commit it decrements the counter.
    Before a begin/commit/rollback work I check the number of pending transactions using "SELECT @@TRANCOUT". Whenever I find a diference between the number of transaction nad the my counter I generate an exception and terminate the program with an error message.
    
HIH
Nuno
 
 

-----Mensagem original-----
De: Martha Rangel [mailto:[email protected]]
Enviada: quinta-feira, 11 de Agosto de 2005 14:10
Para: [email protected]
Assunto: [fourjs-users] Sql Server, pessimist locking and transactions
Importância: Alta



Hi everyone!

 

I am having a problem in one customer who is running 4GL against a SQL Server database.  The error is raised upon the commit work, the commit work causes an error - 6372, with sqlca.sqlerrd[2] = 0!.  

 

On Informix systems, the program runs without errors.  I reviewed the code and everything is correct.  

 

For what I have read, it seems is a missing alignment between @TRANCOUNT and the expected trancount from the ODBC driver.  

 

Any ideas would be appreciated.  

 

 


  _____  


Martha Rangel

Software Developer

 



 

Phone: (613) 226-5511 ext. 2215
Fax: (613) 226-3377
Email: [email protected]
1 Antares Drive, Suite 400
Ottawa, Ontario, Canada
K2E 8C4

 

This message and any attachments are confidential to the ordinary user of the e-mail address to which it was addressed and may also be privileged. If you are not the addressee you may not copy, forward, disclose or use any part of the message or its attachments and if you have received this message in error, please notify the sender immediately by return e-mail and delete it from your system. The sender does not accept liability for any errors or omissions in the context of this message that arise as a result of Internet transmission. Any opinions contained in this message are those of the author and are not given or endorsed by the Harris company or office through which this message is sent unless otherwise clearly indicated in this message and the authority of the author to so bind the Harris entity referred to is duly verified.
image001.jpg (image/jpeg, 1.8 KB) - not displayed
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.