Brian's Waste of Time

Fri, 19 Dec 2003

Intercept Standard Library - Transactions

I have started to implement standard interception tasks and idioms in the intercept library such as transaction management. Transaction management is a fun one to bite off first because the most popular O/R frameworks use connection-oriented transactions. OJB ties transactions to connections in PB and OTM API's (I know how to cheat the OTM API for this, but I don't want to cheat), Hibernate ties them to the Session (which is tied to a DB connection).

The base implementation is just around an abstract factory designed to be configured via type 2 or 3 IoC. The only implementation of the Transactionfactory in CVS right now is for ODMG, which works with both the aforementioned API's (though I have never used Hibernate's). Any Hibernate guys want to catch up with me on the "right way" to do this for Hibernate transactions? I am afraid I am going to have to leap off the deep and and provide a whole wrapper around Hibernate the way the Spring developers did -- ick (not at Spring, but at limiting how they use it). The transaction-per-thread model from JTA is handy. On that note, JTA transactions will go in when I figure a nice way to not break the build for people who don't want to jump through Sun's legal hoopla to get the interfaces.

Having toyed with implementations of the standard type stuff people talk about with interception (and aspects) the obviousness of interception going hand in hand with type 2 IoC leaps out hard.

2 writebacks [/src/java/commons-intercept] permanent link