Tracy Chen wrote:
> Sent: Freitag, 6. Oktober 2006 10:39
> To: [email protected]
> Subject: transaction and autocommit
>
> Hello all,
>
> I've read the DB reference document and see "The AUTOCOMMIT
> mode is activated (Loader default value)." and "The Loader
> terminates each sql statement implicitly with a COMMIT."
>
> Now I need to do some sql inside a transaction, commit or
> rollback together in the end of this transaction.
>
> Shall I first use "autocommit off" (because the default is
> on) before my "subtrans begin" , write all my sql commands
> till end , commit/rollback , then set "autocommit on" again?
>
> Is this the right way to handle autocommit and
> transaction(subtransaction)?
>
> Thanks in advance
>
1. it is necessary to switch off autocommit, therefore 'autocommit off'
is ok.
2. why do you want to start with subtrans begin?
Do you have subtransactions in your transaction or did you just miss
the fact,
that after connect to the database kernel the first transaction is
started and
the next one is started implicitly when the first one is ended with
COMMIT / ROLLBACK?
--> AUTOCOMMIT OFF
<all your statements you want to have in your transaction without
SUBTRANS BEGIN as first statement>
COMMIT or ROLLBACK
AUTOCOMMIT ON
Elke
SAP Labs Berlin
>
> Tracy Chen
>
--
MaxDB Discussion Mailing List
For list archives: http://lists.mysql.com/maxdb
To unsubscribe: http://lists.mysql.com/[EMAIL PROTECTED]