Wednesday, February 16, 2005

Websphere 5.1 - Access Intent

Today I was fighting with a bug while migrating an webapp from WAS 5.0 to 5.1. One of the EJB had a finder method which had a join query. So whenever this particular method is called during runtime it would throw this exception:

com.ibm.ws.ejbpersistence.utilpm.PersistenceManagerException: PMGR1001E: No such DataAccessSpec :FindMeetingTemplatesByPropId. The backend datastore does not support the SQLStatement needed by this AccessIntent: access intent: (pessimistic update-weakestLockAtLoad)(collections: transaction/25) (resource manager prefetch: 0).

After investigation its found that its due to the Default Access Intent which is PessimisticUpdate-WeakestLockAtLoad. For join queries in Oracle backend this Update access intent wont work. Generally this access intent must be used for UPDATE...WHERE.. queries. To fix this in EJB Deployment Descriptor :

1. Goto Access
2. In Access Intent for Entities 2.x (Method Level) -> Add wsPessimesticRead intent with the method that is faulting.
3. Restart your server and thats it.. the bug is fixed!

I also think its a good idea to know about Concurrency Control.

No comments:

Disqus for techtalk