yep. cut and paste straight from project code. I'm not sure why it was giving me that error. I thougth maybe it had something to do with setAutoCommit in the OJB.properties so I set it to 0. But, that failed to write any of my transactions. So i set it back to 1. I haven't seen the problem crop back up in the last hour. Is there a way that transactions could be hanging out there for some reason.
As a side not (as i mentioned in an AW: post) the data DID committ to the database. The error was actually thrown after the everything had been written to the database. Wierd!? Huh? :-). I'll let you know when/if I see more. BTW I am using Win2k, Tomcat 4.0.4, ojb-0.9.5 and MySQL 3.23.43 with mm.mysql-2.0.11.jar Brandon Goodin Phase Web and Multimedia P (406) 862-2245 F (406) 862-0354 [EMAIL PROTECTED] http://www.phase.ws > -----Original Message----- > From: Armin Waibel [mailto:[EMAIL PROTECTED]] > Sent: Wednesday, December 11, 2002 2:16 AM > To: OJB Users List > Subject: Re: Not in transaction error > > > 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]> > > -- To unsubscribe, e-mail: <mailto:[EMAIL PROTECTED]> For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>
