Am Montag, 11. Juni 2012 21:16:56 UTC+2 schrieb Gili Tzabari:

  What about committing transactions? If I have to invoke 
> Factory.getConnection().commit() after the JOOQ code I still end up having 
> to catch both DataAccessException and SQLException. Couldn't 
> Factory.getConnection() return a wrapper object?
>

Not really. There is no sane way to extend most JDBC classes in Java code - 
compilation will break with different versions of Java, for example.

I would prefer if "new Factory()" would accept a wrapper object instead; 
that would ease the migration path to new versions of JDBC and make the API 
cleaner. If this wrapper would have this API:

    getConnection() // get underlying JDBC connection
    commit() // commit the current transaction
    rollback() // ...

then such things would be possible.

Reply via email to