At the risk of talking to myself, I got something working. I ended up
making a new class (which I rather unimaginatively called
DatasourceDataSource) that takes a RIFE Datasource as input. It
implements javax.sql.DataSource. It returns instances of a DbConnection
wrapper (DbConnectionConnection) that delegates to either the
DbConnection object or to the underlying JDBC object where DbConnection
doesn't have an equivalent method.
I've posted my code at
http://rifers.org/paste/show/1600 and
http://rifers.org/paste/show/1601 if anyone wants to check it out. I
have successfully wired this to iBatis and Quartz using Spring; I
haven't exhaustively tested it but it appears to work. I used it in
combination with the DatasourceFactory and
AutowiringParticipantSpringWeb classes which are both on the RIFE Wiki's
"Spring integration" page.
To make this work, I had to modify DbConnection to add a getter for the
underlying Connection object. That method is posted at
http://rifers.org/paste/show/1602 (not that there's much to it.)
The only place where DbConnectionConnection is more than just a simple
delegating wrapper is in the setAutoCommit() method, which calls
beginTransaction() or commit() on the DbConnection object. I *think*
that's the right implementation to allow non-RIFE code to interact with
RIFE transactions. (Less certain about the commit() call than the rest
of it, though.)
Is this approach reasonable?
-Steve
_______________________________________________
Rife-devel mailing list
Rife-devel@...
http://lists.uwyn.com/mailman/listinfo/rife-devel