Hi,

I've just now began using the statement "Server conn Begin Transaction", and have 
uncovered a snag (bug?) in my preliminary testing. I'm using MB 6.5 with Oracle 9i, 
but it's most likely generic.

According to the MB manual, "Begin Transaction" caches all commands until either a 
"Server conn Commit" or "Server conn Rollback" is issued. So far so good.

But it seems that using "Begin Transaction" puts the transaction environment into some 
sort of READ ONLY state unless you keep using this statement over and over.

This statement sequence works and inserts the values 1 - 4

Hconn = Server_Connect (...)
Server Hconn Begin Transction
Hstmt = Server_Execute (Hconn, "Insert Into TEST Values (1)")
Hstmt = Server_Execute (Hconn, "Insert Into TEST Values (2)")
Server Hconn Commit
Server Hconn Begin Transction
Hstmt = Server_Execute (Hconn, "Insert Into TEST Values (3)")
Hstmt = Server_Execute (Hconn, "Insert Into TEST Values (4)")
Server Hconn Commit

If I remove the second "Begin Transaction", i.e.:

Hconn = Server_Connect (...)
Server Hconn Begin Transction
Hstmt = Server_Execute (Hconn, "Insert Into TEST Values (1)")
Hstmt = Server_Execute (Hconn, "Insert Into TEST Values (2)")
Server Hconn Commit
Hstmt = Server_Execute (Hconn, "Insert Into TEST Values (3)")
Hstmt = Server_Execute (Hconn, "Insert Into TEST Values (4)")
Server Hconn Commit

The statement inserting the value 3 throws an error saying "INSERT, DELETE or UPDATE 
statements cannot be executed in a READ ONLY transaction" (transluted from Danish so 
the wording may be a bit off).

Clearly issuing a "Begin Transaction" triggers an undocumented side effect (probably 
using Oracle's "SET TRANSACTION" command). And COMMIT clearly doesn't clear this 
state, forcing one to keep using "Begin Transaction", a somewhat problematic behaviour 
imho. The logical assumption would have it return to the default (auto-commit?) 
behaviour after a rollback/commit statement.

Can anyone confirm this problematic behaviour ?

Has anyone else used this statement ? If so, has anyone experienced this kind of 
behaviour before ?

Best regards / Med venlig hilsen
Lars V. Nielsen
--------------------------------------------------------
Hvenegaard & Meklenborg
Rugaardsvej 55, DK-5000 Odense C
Denmark
http://www.hvm.dk

Reply via email to