Hi Brandon,

----- Original Message -----
From: "Phase Web and Multimedia" <[EMAIL PROTECTED]>
To: "OJB Users List" <[EMAIL PROTECTED]>
Sent: Wednesday, December 11, 2002 9:33 AM
Subject: AW: Not in transaction error


>
> The item is committed to the database. Yet the error is thrown.

Strange, first time I heared about such a problem. Sounds like a
synchronization problem, but your code seems ok.
Is this the used code?

regards,
Armin

>
> > I am getting the following error... As you can see my code IS
calling
> > beginTransaction() BEFORE commitTransaction(). WHY am i getting
> > this error?
> >
> > ERROR:
> >
> > db.DBWrite - Not in transaction, call begin() before commit()
> > org.apache.ojb.broker.TransactionNotInProgressException: Not in
> > transaction,
> > call begin() before commit()
> >
> >
> > CODE ERROR IS CALLED ON:
> >
> > public static void execute(Object object){
> >
> >        PersistenceBroker broker = null;
> >
> >        try{
> >            broker =
PersistenceBrokerFactory.defaultPersistenceBroker();
> >            broker.beginTransaction();
> >            if (object!=null) {
> >            broker.store(object);// <-- this is the line the
> > error is being
> > thrown on
> >            }
> >            broker.commitTransaction();
> >
> >         } catch (PersistenceBrokerException  ex) {
> >             logger.error(ex.getMessage(), ex.fillInStackTrace());
> >         } catch (PBFactoryException  ex) {
> >             logger.error(ex.getMessage(), ex.fillInStackTrace());
> >         } finally {
> >
> >         if (broker != null)
> >         broker.close();
> >
> >        }
> >     }
> >
> > Brandon Goodin
> > Phase Web and Multimedia
> > P (406) 862-2245
> > F (406) 862-0354
> > [EMAIL PROTECTED]
> > http://www.phase.ws
> >
> >
> >
> > --
> > 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]>
>
>
>


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

Reply via email to