[redhat-ccm-list] Persistence exception

Dhanya Unnikrishnan dhanya at triconinfotech.com
Sat Mar 6 06:02:48 UTC 2004


There is a small change in the Java code.. It is like this..

"
public class Employee {

	public void getEmployee(){
		
		System.out.println("Employee::getEmployee");

		Session session = SessionManager.getSession();
		System.out.println("Got session = "+session);
		DataQuery query = session.retrieveQuery("com.employee.employeeFetch");
		System.out.println("Got query = "+query);
		System.out.println("Query size = "+query.size());
		
		while(query.next()) {
			System.out.println((String) query.get("lastName"));
		}

	}
"

-----Original Message-----
From: redhat-ccm-list-admin at redhat.com
[mailto:redhat-ccm-list-admin at redhat.com]On Behalf Of Dhanya
Unnikrishnan
Sent: Saturday, March 06, 2004 11:16 AM
To: redhat-ccm-list at redhat.com
Subject: [redhat-ccm-list] Persistence exception



I have a jsp page. When I submit it, I call a Java class which tries to get the values from the database thru a pdl file. I don't know why it fails. The error I get is:

"
com.arsdigita.persistence.PersistenceException: Can't retrieve a connection outside of a transaction.  This typically means that you have cached a DataObject across page loads and are now trying to access it.  This operation is not currently supported.
	at com.arsdigita.persistence.TransactionContextImpl.getConnection(TransactionContextImpl.java:113)
	at com.arsdigita.persistence.SessionImpl.getConnection(SessionImpl.java:188)
	at com.arsdigita.persistence.DataStore.getConnection(DataStore.java:95)
	at com.arsdigita.persistence.DataStore.fireOperation(DataStore.java:274)
	at com.arsdigita.persistence.DataStore.fireOperation(DataStore.java:168)
	at com.arsdigita.persistence.DataQueryImpl.executeQuery(DataQueryImpl.java:1048)
	at com.arsdigita.persistence.DataQueryImpl.size(DataQueryImpl.java:936)...................
"

My PDL file is as follows:

"
model employee;

query employeeFetch {

	Integer subscriberID;
	String firstName;
	String lastName;
	String employeeSex;
	String employeeAddress;

	do {
	
		select subscriber_id, fname, lname, sex, address from employee e		
		
	} map {
	
		subscriberID = e.subscriber_id;
		firstName = e.fname;
		lastName = e.lname;
		employeeSex = e.sex;
		employeeAddress = e.address;
		
	}
	

}
"

My Java file where I am trying to access the PDL file is:

"public class Employee {

	public ArrayList getEmployee(){

		Session session = SessionManager.getSession();

		DataQuery query = session.retrieveQuery("employee.employeeFetch");
		while(query.next()) {

			System.out.println((String) query.get("lastName"));

		}
	}

"


Information contained in this E-MAIL being proprietary to Tricon Infotech Private Limited  is
'privileged' and 'confidential' and intended for use only by the individual or entity to which it 
is addressed. You are notified that any  use, copying or  dissemination  of the  information 
contained in this E-MAIL in any manner whatsoever is strictly prohibited.


-- 
Redhat-ccm-list mailing list
Redhat-ccm-list at redhat.com
https://www.redhat.com/mailman/listinfo/redhat-ccm-list
Archives: https://www.redhat.com/pipermail/redhat-ccm-list/




Information contained in this E-MAIL being proprietary to Tricon Infotech Private Limited  is
'privileged' and 'confidential' and intended for use only by the individual or entity to which it 
is addressed. You are notified that any  use, copying or  dissemination  of the  information 
contained in this E-MAIL in any manner whatsoever is strictly prohibited.





More information about the Redhat-ccm-list mailing list