+

Search Tips   |   Advanced Search

Access intent exceptions

The following are exceptions that occur in response to the application of access intent policies.

com.ibm.ws.ejbpersistence.utilpm.OptimisticUpdateFailedException

If an update fails under optimistic concurrency because fields changed within another transaction between load and store requests, an OptimisticUpdateFailedException is raised and the commit fails.

com.ibm.ws.ejbpersistence.utilpm.PersistenceManagerException

If the method that drives the ejbLoad() method is configured to be read-only but updates are then made within the transaction that loaded the bean's state, an exception is thrown during invocation of the ejbStore() method, and the transaction is rolled back. Likewise, the ejbRemove() method cannot succeed in a transaction set as read-only. If an update hint is applied to methods of entity beans with bean-managed persistence, the same behavior and exception results. The forwarded exception object contains the message string PMGR1103E: update instance level read only bean beanName

This exception is also thrown if the applied access intent policy cannot be honored because a finder, ejbSelect, or container-managed relationship (CMR) accessor method returns an inherently read-only result. The forwarded exception object contains the message string PMGR1001: No such DataAccessSpec - methodName

The most common occurrence of this error is when a custom finder containing a read-only EJB Query Language (EJB QL) statement is called with an applied access intent of wsPessimisticUpdate or wsPessimisticUpdate-Exclusive. These policies require the use of a USE AND KEEP UPDATE LOCKS clause on the SQL SELECT statement to be executed, but a read-only query cannot support USE AND KEEP UPDATE LOCKS. Other examples of read-only queries include joins; the use of ORDER BY, GROUP BY, and DISTINCT keywords.

To eliminate the exception, edit the EJB query so that it does not return an inherently read-only result or change the access intent policy being applied.

  • If an update access is required, change the applied access intent setting to wsPessimisticUpdate-WeakestLockAtLoad or wsOptimisticUpdate.

  • If update access is not truly required, use wsPessimisticRead or wsOptimisticRead.

  • If connection sharing between entity beans is required, use wsPessimisticUpdate-WeakestLockAtLoad or wsPessimisticRead.

com.ibm.websphere.ejb.container.CollectionCannotBeFurtherAccessed

If a lazy collection is driven after it is no longer in scope, and beyond what has already been locally buffered, a CollectionCannotBeFurtherAccessed exception is thrown.

com.ibm.ws.exception.RuntimeWarning

If an application is configured incorrectly, a run-time warning exception is thrown as the application starts; startup is ended. We can validate an application's configuration by choosing the verify function. Some examples of misconfiguration include:

  • A method configured with two different access intent policies

  • A method configured with an undefined access intent policy


Related tasks

  • Use access intent policies for EJB 2.x entity beans

  • Access intent assembly settings