Apache JDO Project - Re: Commit behaviour upon JDOOptimisticVerificationException during

This is Interesting: Free IT Magazines  
Home > Archive > Apache JDO Project > November 2006 > Re: Commit behaviour upon JDOOptimisticVerificationException during





You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

Author Re: Commit behaviour upon JDOOptimisticVerificationException during
Jörg von Frantzius

2006-11-02, 1:11 pm

Alright, I just saw that JPA spec says in "5.5.2.1 The EntityTransaction
Interface":

If the EntityTransaction.commit operation fails, the persistence
provider must roll back the transaction.

So I take back my proposal in order to align with JPA.

Regards,
Jörg

Jörg von Frantzius schrieb:
> Dear experts,
>
> after looking at the spec, and 13.4.4 "Non-managed environment" in
> particular, I'm somewhat puzzled about what the expected behaviour of
> javax.jdo.Transaction.commit() should be upon encountering an
> exception during flush. What JPOX currently does is an automatic
> rollback of the DB connection and of the PM's caches, calling
> sync.afterCompletion(Status.STATUS_ROLLEDBACK) and setting the state
> of the transaction to not-active. I wonder whether that's really
> intended.
>
> While there isn't much a user can do about an optimistic failure
> during flush, there could be any SQLException happening during flush
> that the user might want to catch and try to recover from, I imagine.
> He won't be able to do so if the transaction is automatically
> rolled-back.
>
> So my proposal would be that upon failure during flush, nothing should
> be done by the implementation but throwing the appropriate exception.
>
> Regards,
> Jörg
>




Sponsored Links






Free braindumps | Software forum | Database administration forum

Copyright 2003 - 2008 webservertalk.com