Your stacktrace indicates that you have mixed PersistenceBroker and ODMG 
Transactions !

The code you present here does IMHO not match to the stacktrace where we 
see a org.apache.ojb.odmg.TransactionImpl.abort() first.
Your code snippet does not contain such a call???

cheers,
Thomas


Thomas Fahrmeyer wrote:
> Hi,
> 
> If I try to save a new object I get the exeption
> 
> ----- Root Cause -----
> org.apache.ojb.broker.TransactionNotInProgressException
>       at
> org.apache.ojb.broker.singlevm.PersistenceBrokerImpl.abortTransaction(Persis
> tenceBrokerImpl.java:266)
>       at org.apache.ojb.odmg.TransactionImpl.abort(TransactionImpl.java:505)
>       at
> de.virtualsolution.struts.actions.UpdateSelectionAction.updateSelectionODMG(
> UpdateSelectionAction.java:225)
> 
> that happend with the following code:
> 
> 
>>>>>snippet
>>>>
>            broker.beginTransaction();
> 
>            // a new object
>               broker.store(sel);
> 
>             // 7. commit transaction
>             broker.commitTransaction();
>         } catch (PersistenceBrokerException pbe) {
>             if (broker.isInTransaction()) {
>                 broker.abortTransaction();
>             }
> 
>             m_log.error("Selection could not be saved ! Transaction is
> rolled back.", pbe);
>         } finally {
>             if (broker != null) {
>                 broker.close();
>             }
>         }
> <<<<< end
> 
> the call to commitTransaction() raises this exception.
> 
> The object is saved correctly anyway. Is that related to the autoCommit
> Settings in OJB.properties ? Which settings should I use if I wanna use
> begin- and commitTransaction() any time ?
> I have tried to set the autoCommit-level to 2 in OJB.properties and even
> ignoreAutoCommitException to true, but doesn't change anything.
> 
> Can someone help me out (i'm convinced ;)
> 
> bye
> Thomas
> 
> 
> --
> To unsubscribe, e-mail:   <mailto:[EMAIL PROTECTED]>
> For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>
> 
> 
> 
> 



--
To unsubscribe, e-mail:   <mailto:[EMAIL PROTECTED]>
For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>

Reply via email to