openjpa-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Marina Vatkina <Marina.Vatk...@Sun.COM>
Subject Re: OPENJPA-182: reuse Connection constants or create our own?
Date Tue, 10 Apr 2007 23:56:11 GMT
It should be ok anyway in the same VM. Unfortunately I had conflicting messages 
on weather it's the name or the ordinal that is guaranteed to work across the 
VMs :(.

-marina

Patrick Linskey wrote:
> Fascinating. Happily, as it turns out, we never compare these things
> directly; instead, we extract a value from the enums and use that. The
> value is populated in the enum constructor:
> 
> public enum IsolationLevel {
>     DEFAULT(-1),
>     NONE(Connection.TRANSACTION_NONE),
>     READ_UNCOMMITTED(Connection.TRANSACTION_READ_UNCOMMITTED),
>     READ_COMMITTED(Connection.TRANSACTION_READ_COMMITTED),
>     REPEATABLE_READ(Connection.TRANSACTION_REPEATABLE_READ),
>     SERIALIZABLE(Connection.TRANSACTION_SERIALIZABLE);
> 
>     private final int _connectionConstant;
> 
>     private IsolationLevel(int connectionConstant) {
>         _connectionConstant = connectionConstant;
>     }
> 
>     protected int getConnectionConstant() {
>         return _connectionConstant;
>     }
> }
> 
> Do you know if the getConnectionConstant() method would return the same
> value for different instances of the "same" module?
> 
> -Patrick
> 


Mime
View raw message