commons-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Oliver Zeigermann <>
Subject Re: [transaction] Duplicate TX id's
Date Fri, 20 May 2005 13:28:17 GMT
On 5/20/05, David J. M. Karlsen <> wrote:
> Hi!
> I keep getting ResourceManagerExceptions with "Duplicate transaction
> id". I took a look at the implementation of FileResourceManager - and
> generatedUniqueID only returns system.getCurrentMillis() - which isn't
> random enough in a multithreaded environment.

Hmmm, I wonder why this is so? Looking at generatedUniqueTxId() it
checks if the transaction Id already is in use by

            } while (getContext(txId) != null);

Are you sure this is the reason for your exceptions?

> This should probably be changed into a UUID algorithm or something.

This would be a good idea in any case :)

> Also - the LoggerInterface has a createLogger method - but this is an
> instance method - so the logging stuff should probably be changed into a
> factory that creates logger of a specified type?

Would be cleaner, yes.

> I also miss a LoggerFacade for jakarta's own Commons Logging (which
> would make the other classes redundant).

Not quite. Commons Logging does not map to the Jakarta Slide logging
system which makes heavy use of commons transaction. That's why there
is such a LoggerFacade. Aside, a Commons logging implementation would
be a good idea :)

> Anyone?

If you could propose any patches I would be happy to consider them ;)


To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message