I am currently implementing an H2 'database dialect' for SymmetricDS
(www.symmetricds.org).    I am trying to figure out the best way to
access a 'transaction id' from an H2 trigger.  The following is the
Java code I have come up with.  Does anybody have suggestions for
improvements (or more likely can they poke holes in my approach)?

    protected String getTransactionId(Connection c) {
            JdbcConnection con = (JdbcConnection) c;
            Session session = (Session) con.getSession();
            return StringUtils.leftPad(Integer.toString(session.getId
()), 3, "0") + "-"
                    + session.getFirstUncommittedLog() + "-" +
session.getFirstUncommittedPos();
    }

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "H2 
Database" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to 
[email protected]
For more options, visit this group at 
http://groups.google.com/group/h2-database?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to