commons-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From sebb <>
Subject Re: [POOL2] Pooling mutable objects
Date Mon, 09 Feb 2015 11:07:57 GMT
On 9 February 2015 at 05:07, Matthew Hall <> wrote:
> On Sun, Feb 08, 2015 at 11:07:59AM +0100, Michael Osipov wrote:
>> How would you propose to use it?
>> I would still need a random number or do you recomment to use a static one
>> and simply increment during the lifetime of the application?
>> If so, thing might cause trouble in the future because I would probably
>> store the session information in a database for analysis issues and woudl
>> have collisions.
>> Michael
> Then you either have to use real big random's like UUID and accept it'd be
> slow, or derive the numeric values from a native DB counter (for example, a
> Redis counter, or a PostgreSQL sequence data type).

This is a separate issue from the pooling problem.

Depending on how you are intending to create the sessions, it may be
possible to use a cheaper method.
For example combining system time with System.identityHashCode should
work if only a single classloader is ever used at one time.

> Matthew.
> ---------------------------------------------------------------------
> To unsubscribe, e-mail:
> For additional commands, e-mail:

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

View raw message