db-jdo-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Craig L Russell <Craig.Russ...@Sun.COM>
Subject Re: setRollbackOnly() and what is thrown by commit()
Date Mon, 13 Nov 2006 15:09:57 GMT
Hi Andy,

Good catch. It's definitely a spec bug that I expect that we should  
fix in a maintenance release.

Please file a JIRA. We should probably have a test case written for  
it as well.

Thanks,

Craig

On Nov 13, 2006, at 4:52 AM, Andy Jefferson wrote:

> Hi,
>
> in the JDO2-final spec 13.4.5
> <spec>
> Once a transaction has been marked for rollback via  
> setRollbackOnly, the
> commit method will always fail with JDOFatalDataStoreException. The  
> JDO
> implementation must not try to make any changes to the database  
> during commit
> when the transaction has been marked for rollback.
> </spec>
>
> whereas in the javadocs for javax.jdo.Transaction "setRollbackOnly"  
> we have
> "Sets the rollback-only status of the transaction to <code>true</ 
> code>. After
> this flag is set to <code>true</code>, the transaction can no  
> longer be
> committed, and any attempt to commit the transaction will throw
> <code>JDOUserException<code>."
>
> So which exception should be thrown here ...  
> JDOFatalDataStoreException or
> JDOUserException ? probably the version in the spec.
>
> Do you require a JIRA ?
>
> -- 
> Andy

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


Mime
View raw message