You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@ofbiz.apache.org by Justin Robinson <ju...@venturenet.co.za> on 2011/11/02 16:23:32 UTC

Not committing transaction, status is No Transaction (6)

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

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

Posted by BJ Freeman <bj...@free-man.net>.
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.
> 

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

Posted by Paul Foxworthy <pa...@cohsoft.com.au>.
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
> 

--
View this message in context: http://ofbiz.135035.n4.nabble.com/Not-committing-transaction-status-is-No-Transaction-6-tp3975397p4018798.html
Sent from the OFBiz - User mailing list archive at Nabble.com.