Bruce, Aditya I might be wrong here, but using Database.ReadOnly should make render it impossible to use the objects loaded in this transaction as part of an update operation later as Castor will not hold them in its (transaction/dirty/performance) caches which is a implementation requirement for long transactions to succeed..
I hope this helps. Werner On Tue, 1 Jun 2004 11:49:39 -0700, Aditya Akella wrote: >Hi Bruce, > >We are using the Database.ReadOnly for all the queries while doing the edit. >Also the db.open() and db.commit() is not in the same method where the query >is made , but in a different struts action class from where the method is >called. > >Is that contributing to the TransactionNotInProgress Exception ? > >All methods that make the query are static final while the action method >that calls it is not. > >I've attached a portion of the mapping file. > >Thanks, >Aditya > > > > >-----Original Message----- >From: Bruce Snyder [mailto:[EMAIL PROTECTED] >Sent: Friday, May 28, 2004 10:21 PM >To: [EMAIL PROTECTED] >Subject: Re: [castor-user] Transaction not in progress > > > >Aditya Akella wrote: > >> Hi All, >> >> I'm getting error for the following code snippet >> >> >> .......//some code >> PatientForm ptForm = (PatientForm)form; >> .......//some code >> myDb = jdo.getDatabase(); >> myDb.begin(); >> >> PatientBizDelegate.processFillUpLists(ptForm,myDb);//this method has >will >> fill up 8 Lists and set them to the form obj. Data is filled up from >> cache(all these lists will be using castor). >> forward = >> >PatientBizDelegate.processAddUpdateOfPatient(ptJdo,ptForm,forward,logOutput, >> myDb); >> myDb.commit(); >> myDb.close(); >> >> >> here is the method for processFillUpLists >> >> public static final PatientForm processFillUpVectors(PatientForm >> patientForm, Database myDb) throws PersistenceException >> { >> List ptypeList = PatientLiteDB.getPatientType(myDb); >> List relcationList= PatientLiteDB.getPatientRelationCode(myDb); >> List pssList= PatientLiteDB.getSignatureSource(myDb); >> List psaList= PatientLiteDB.getSourceOfAdmissionList(myDb); >> List mpList= ProviderDB.getMainProviderJdoList(myDb); >> .......... //here rest of the code follows >> return patientForm; >> } >> >> here is the code snippet for one of the above methods, and the rest will >be >> of the same pattern. >> >> public static final List getPatientRelationCode(Database myDb) throws >> PersistenceException >> { >> List prcList = new ArrayList(); >> OQLQuery productOql = myDb.getOQLQuery("SELECT obj FROM >> com.PCPgo.prm.web.util.PatientReleaseCode obj"); >> QueryResults results = productOql.execute(Database.ReadOnly); >> while (results.hasMore()) >> { >> prcList.add(results.next()); >> } >> results.close(); >> productOql.close(); >> return prcList; >> } >> >> NOTE: All the above code works fine when a single user using the system. >If >> I've more than 2 users I'm getting the following error more often. This >also >> happens when we are testing with more than 3 virtual users. >> >> >> java.lang.IllegalStateException: Transaction not in progress -- must open >a >> transaction in order to perform this operation >> at >> >org.exolab.castor.persist.TransactionContext.prepare(TransactionContext.java >> :1434) >> at >org.exolab.castor.jdo.engine.DatabaseImpl.commit(DatabaseImpl.java:528) >> at >> >com.PCPgo.prm.web.patient.PatientLiteAction.execute(PatientLiteAction.java:2 >> 41) > >Aditya, > >I'd like to see the mapping descriptor for these objects. More >specifically, what type of locking are you using for these objects? >Below is a link to some docs on locking within Castor: > > http://www.castor.org/locking.html > >I'm thinking that your problem may be solved using a better locking >strategy. > >Bruce >-- >perl -e 'print >unpack("u30","<0G)[EMAIL PROTECTED]&5R\\"F9E<G)E=\\$\\!F<FEI+F-O;0\\`\\`");' > >The Castor Project >http://www.castor.org/ > >Apache Geronimo >http://incubator.apache.org/projects/geronimo.html > > > >----------------------------------------------------------- >If you wish to unsubscribe from this mailing, send mail to >[EMAIL PROTECTED] with a subject of: > unsubscribe castor-user > ----------------------------------------------------------- If you wish to unsubscribe from this mailing, send mail to [EMAIL PROTECTED] with a subject of: unsubscribe castor-user
