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

Reply via email to