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]>