[redhat-ccm-list] Persistence exception
Vadim Nasardinov
vadimn at redhat.com
Sat Mar 6 14:34:31 UTC 2004
You want to do something like this:
public List getEmployee2() {
TransactionContext txn = SessionManager.getSession()
.getTransactionContext();
txn.beginTxn();
try {
return getEmployee();
} finally {
txn.commitTxn();
}
}
where getEmployee2() is a new method that wraps a transaction
around your current method getEmployee().
On Saturday 06 March 2004 00:37, Dhanya Unnikrishnan wrote:
> 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)
More information about the Redhat-ccm-list
mailing list