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


Reply via email to