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
<class name="com.PCPgo.prm.web.patient.PatientJdo" identity="patientId" key-generator="seqgen_patid">
<description>Patient Info</description>
<map-to table="Patient" xml="group"/>
<field name="patientId" type="long">
<sql name="PA_PATIENT_ID" type="bigint" />
</field>
<!--
<field name="ptId" type="string">
<sql name="pt_id" type="bigint"/>
</field>
-->
<field name="providerPatientTypeId" type="string">
<sql name="PPT_ID" type="bigint"/>
<xml node="element"/>
</field>
<field name="paPrefix" type="string">
<sql name="PA_PREFIX" type="varchar" />
</field>
<field name="paFirstName" type="string">
<sql name="PA_FIRST_NAME" type="varchar" />
</field>
<field name="paLastName" type="string">
<sql name="PA_LAST_NAME" type="varchar" />
</field>
<field name="paMiddleName" type="string">
<sql name="PA_MIDDLE_NAME" type="varchar" />
</field>
<field name="paSuffix" type="string">
<sql name="PA_SUFFIX" type="varchar" />
</field>
<field name="paBirthDate" type="date">
<sql name="PA_BIRTH_DATE" type="date" />
</field>
<field name="paDateOfDeath" type="date">
<sql name="PA_DATE_OF_DEATH" type="date" />
</field>
<field name="paGender" type="string">
<sql name="PA_GENDER" type="varchar" />
</field>
<field name="paMaritalStatus" type="string">
<sql name="PA_MARITAL_STATUS" type="varchar" />
</field>
<field name="paSsn" type="string">
<sql name="PA_SSN" type="varchar" />
</field>
<field name="paMrn" type="string">
<sql name="PA_MRN" type="varchar" />
</field>
<field name="paAdmissionDate" type="date">
<sql name="PA_ADMISSION_DATE" type="date" />
</field>
<field name="paPrimarycareMd" type="string">
<sql name="pa_primarycare_md" type="varchar" />
</field>
<field name="paReferringMd" type="string">
<sql name="pa_referring_md" type="varchar" />
</field>
<field name="paHomeAddress1" type="string">
<sql name="pa_home_address1" type="varchar" />
</field>
<field name="paHomeAddress2" type="string">
<sql name="pa_home_address2" type="varchar" />
</field>
<field name="paHomeCity" type="string">
<sql name="pa_home_city" type="varchar" />
</field>
<field name="paHomeState" type="string">
<sql name="pa_home_state" type="varchar" />
</field>
<field name="paHomeZipcode" type="string">
<sql name="pa_home_zipcode" type="varchar" />
</field>
<field name="paHomePhone" type="string">
<sql name="pa_home_phone" type="varchar" />
</field>
<field name="paMobilePhone" type="string">
<sql name="pa_mobile_phone" type="varchar" />
</field>
<field name="paEmail" type="string">
<sql name="pa_email" type="varchar" />
</field>
<field name="paEmergencyContactName" type="string">
<sql name="pa_emergency_contact_name" type="varchar" />
</field>
<field name="paEmergencyContactPhone" type="string">
<sql name="pa_emergency_contact_phone" type="varchar" />
</field>
<field name="paEmployerName" type="string">
<sql name="pa_employer_name" type="varchar" />
</field>
<field name="paWorkAddress1" type="string">
<sql name="pa_work_address1" type="varchar" />
</field>
<field name="paWorkAddress2" type="string">
<sql name="pa_work_address2" type="varchar" />
</field>
<field name="paWorkCity" type="string">
<sql name="pa_work_city" type="varchar" />
</field>
<field name="paWorkState" type="string">
<sql name="pa_work_state" type="varchar" />
</field>
<field name="paWorkZipcode" type="string">
<sql name="pa_work_zipcode" type="varchar" />
</field>
<field name="paWorkPhone" type="string">
<sql name="pa_work_phone" type="varchar" />
</field>
<field name="paWorkExt" type="string">
<sql name="pa_work_ext" type="varchar" />
</field>
<field name="paFax" type="string">
<sql name="pa_fax" type="varchar" />
</field>
<field name="paEmploymentStatus" type="string">
<sql name="pa_employment_status" type="varchar" />
</field>
<field name="paInfoReleaseAuth" type="boolean">
<sql name="PA_INFO_RELEASE_AUTH" type="char[01]" />
</field>
<field name="patientSignatureSourceCode" type="string">
<sql name="PSS_SOURCE_CODE" type="varchar" />
</field>
<field name="releaseOfInfoCode" type="string">
<sql name="PRC_RELEASE_CODE" type="varchar" />
</field>
<field name="paIhcchsNo" type="string">
<sql name="PA_IHCCHS_NO" type="varchar" />
</field>
<field name="isDependent" type="string">
<sql name="PA_DEPENDENT" type="varchar" />
</field>
<field name="providerId" type="long">
<sql name="PR_PROVIDER_ID" type="bigint"/>
</field>
<field name="sourceOfAdmission" type="string">
<sql name="SOA_CODE" type="varchar" />
</field>
<field name="emergencyContactRelationship" type="string">
<sql name="PA_EMERGENCY_CONTACT_RLTNSHP" type="varchar" />
</field>
<field name="paAccount" type="string">
<sql name="PA_ACCOUNT" type="varchar" />
</field>
<field name="notes" type="string">
<sql name="PA_NOTES" type="varchar" />
</field>
<field name="occupation" type="string">
<sql name="PA_OCCUPATION" type="varchar" />
</field>
<field name="attendingProviderId" type="string">
<sql name="ATTENDING_PROVIDER_ID" type="varchar" />
</field>
<field name="patientDetailValid" type="boolean">
<sql name="IS_PATIENT_DETAIL_VALID" type="char[01]" />
<xml node="element"/>
</field>
</class>
-----------------------------------------------------------
If you wish to unsubscribe from this mailing, send mail to
[EMAIL PROTECTED] with a subject of:
unsubscribe castor-user