openjpa-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Craig L Russell <Craig.Russ...@Sun.COM>
Subject Re: OpenJPA 1.2.1 violates JPA 1.0 specification
Date Sat, 21 Nov 2009 18:14:14 GMT
Hi Amit,

Is the NoResultException the only exception in your transaction? If  
so, I agree that this should not roll back the transaction. And please  
file a JIRA for this.

"Surely there is a TCK test case" that covers this situation?

Craig

On Nov 21, 2009, at 6:25 AM, Amit Puri wrote:

> Hi All
>
> I have a weird problem out here which seems to be violating the JPA  
> 1.0
> specification.
> One of my query which throws a NoResultException results in the  
> complete
> transaction being
> rollled back.I find the following in JPA spec which clearly says that
> NoResultException
> should not result in a roll back.
>
> For your reference here is the section 3.7 of JPA spec from my copy.
>
> Section 3.7 of the JPA 1.0 spec states that:
> ------------------------------------------------------------------------------------------
> PersistenceException
> The PersistenceException is thrown by the persistence provider when a
> problem
> occurs. It may be thrown to report that the invoked operation could  
> not
> complete because of an
> unexpected error (e.g., failure of the persistence provider to open a
> database connection).
> All other exceptions defined by this specification are subclasses of  
> the
> PersistenceException.
> All instances of PersistenceException except for instances of
> NoResultException
> and NonUniqueResultException will cause the current transaction,
> if one is active, to be marked for rollback.
> -------------------------------------------------------------------------------------------
>
> Here is the exception trace.
>
> -------------------------------------------------------------------------------------------
> 2009-11-19 12:15:58,531 ERROR <openjpa-1.2.1-r2180:4612 nonfatal  
> user error>
> org.apache.openjpa.persistence.NoResultException: The query on  
> candidate
> type "class -------" with filter
> "---------------------------------------------------" was configured  
> to have
> a unique result, but no instance matched the query.
>    at  
> org.apache.openjpa.kernel.QueryImpl.singleResult(QueryImpl.java:1299)
>    at org.apache.openjpa.kernel.QueryImpl.toResult(QueryImpl.java: 
> 1221)
> ...
> ...
> 2009-11-19 12:16:04,281 INFO  [Transaction] TX Required: Committing
> transaction  
> org.apache.geronimo.transaction.manager.TransactionImpl@4d004d
> 2009-11-19 12:16:04,640 WARN  [Transaction] Unexpected exception from
> beforeCompletion; transaction will roll back
> <openjpa-1.2.1-r2180:4612 fatal general error>
> org.apache.openjpa.persistence.PersistenceException: The transaction  
> has
> been rolled back.  See the nested exceptions for details on the  
> errors that
> occurred.
>    at
> org 
> .apache.openjpa.kernel.BrokerImpl.newFlushException(BrokerImpl.java: 
> 2163)
>    at org.apache.openjpa.kernel.BrokerImpl.flush(BrokerImpl.java:2010)
> -------------------------------------------------------------------------------------------
>
> Please clarify.
>
> Thanks
> Amit

Craig L Russell
Architect, Sun Java Enterprise System http://db.apache.org/jdo
408 276-5638 mailto:Craig.Russell@sun.com
P.S. A good JDO? O, Gasp!


Mime
View raw message