directory-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Stefan Seelmann <seelm...@apache.org>
Subject Re: Txns & tests heads up
Date Sat, 24 Dec 2011 21:54:14 GMT
On Sat, Dec 24, 2011 at 2:51 PM, Emmanuel Lecharny <elecharny@gmail.com> wrote:
> Hi,
>
> I'm fixing tests in core-integ, and so far, I still have some issues in
> uathz (SearchAuthorizationIT) and in schema. All the other tests are now
> passing.
>
> I have moved the txns borders into the OperationManager, and for searches,
> the cursor commit or abort the txn in the close() and close(exception)
> methods.
>
> The pbs I'm facing are with txns inside another txns (nothing new here, I
> was not trying to fix that, but to clean up the room before starting to
> impelment a fix).
>
> I think we should find a way to implicitely commit or abort the txns even if
> the user does not close() the cursors, otherwise it might be extremely
> painful for them. I was thinking about adding a finalaizer in the cursor to
> finish the txns, but it's not a perfect solution (as it depends on the GC to
> be executed. Damn I miss the C++ explicit destuctors :/).
> Something more useful would be to allow any txns to reuse an existing txns.
> Of course, there are some drawbacks, but I think it's probably a better
> approach.

Don't use finalizer. Better let the cursors implement
java.io.Closeable, when used with the new Java7 try-with-resource
statement [1] Java takes care to close the cursors.

Kind Regards,
Stefan

[1] http://docs.oracle.com/javase/tutorial/essential/exceptions/tryResourceClose.html

Mime
View raw message