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: DatastoreConnection / optimistic txs
Date Sun, 08 Apr 2007 19:00:51 GMT
Hi Erik,

Maybe the best way forward here is for you to propose a change with  
as much detail as I would need to update the spec.

Thanks,

Craig

On Apr 8, 2007, at 10:52 AM, Erik Bengtson wrote:

>> I'm afraid I don't know what you mean by "this feature" and "this
>> change". If you want to guarantee that the datastore connection you
>> get is enlisted in the JDO transaction
>
> tx.setOptimistic(true)
> tx.begin()
> //do some operations here
> JDOConnection conn = tx.getDataStoreConnection();
> conn.getNativeConnection().execute("UPDATE TABLEB SET A=1");
> conn.close();
> tx.rollback();
>
> A flush may or may not be performed before "getDataStoreConnection"  
> gets
> invoked. If a flush is performed, the connection is enlisted in the
> transaction.
>
> So, accessing the datastore connection and doing updates is not  
> portable, since
> the connection may or may not be enlisted in the transaction.
>
> The side effect of my change proposal would make it portable since  
> connections
> are always enlisted in the transaction :)
>
>> we can add a flag to guarantee it.
>
> I'm in favor of breaking backward compatibility and not adding a  
> new flag,
> because currently it's not ACID neither portable.
>

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