Not committing transaction, status is No Transaction (6)

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

Not committing transaction, status is No Transaction (6)

justin.g.robinson
How the transactions work is a bit of a mystery to me.
Can anyone give me a bit of background on what "Not committing transaction,
status is No Transaction (6)" is or rather what conditions result it it.

I have something like this
TransactionUtil.begin()
for(:){

try/catch
some db related code that may throw exceptions

}
TransactionUtil.commit()

Any clues would be helpful, have often had this problem but have never
gotten to the bottom of why it happens.

--
Regards,
Justin
Venture-Net Research & Development
Reply | Threaded
Open this post in threaded view
|

Re: Not committing transaction, status is No Transaction (6)

BJ Freeman
do a search in code for
TransactionUtil.begin
you will see many exammples.
also a fast way to get info is
google search preface by ofbiz
so
ofbiz transaction

Justin Robinson sent the following on 11/2/2011 8:23 AM:

> How the transactions work is a bit of a mystery to me.
> Can anyone give me a bit of background on what "Not committing transaction,
> status is No Transaction (6)" is or rather what conditions result it it.
>
> I have something like this
> TransactionUtil.begin()
> for(:){
>
> try/catch
> some db related code that may throw exceptions
>
> }
> TransactionUtil.commit()
>
> Any clues would be helpful, have often had this problem but have never
> gotten to the bottom of why it happens.
>
Reply | Threaded
Open this post in threaded view
|

Re: Not committing transaction, status is No Transaction (6)

Paul Foxworthy
In reply to this post by justin.g.robinson
Hi Justin,

I'll bet the sequences of events is:

TransactionUtil.begin starts a transaction
An error condition causes the transaction to roll back
The call to TransactionUtil.commit fails with the error you describe, because after the rollback there isn't a transaction any more.

See

http://download.oracle.com/javaee/5/api/javax/transaction/Status.html

for a description of the status codes. For STATUS_NO_TRANSACTION, it says

"No transaction is currently associated with the target object. This will occur after a transaction has completed."

Cheers

Paul Foxworthy

justin.g.robinson wrote
How the transactions work is a bit of a mystery to me.
Can anyone give me a bit of background on what "Not committing transaction,
status is No Transaction (6)" is or rather what conditions result it it.

I have something like this
TransactionUtil.begin()
for(:){

try/catch
some db related code that may throw exceptions

}
TransactionUtil.commit()

Any clues would be helpful, have often had this problem but have never
gotten to the bottom of why it happens.

--
Regards,
Justin
Venture-Net Research & Development
--
Coherent Software Australia Pty Ltd
http://www.coherentsoftware.com.au/

Bonsai ERP, the all-inclusive ERP system
http://www.bonsaierp.com.au/