FWIW I have done plain jdbc with Guice, a year ago for a project. It
was very easy to set up. I ended up with:
o) A way to configure and bind DataSource
x) I didn't bother with providing support for connection pool, as
Oracle Driver comes with build-in CP sames goes Postgresql
o) Did bother on making sure DS is properly closed and driver
unregistered on webapp redeploy or shutdown
o) Made a provider for a Connection (I "hardcoded" connection-per-
transaction approach)
o) Made a transaction interceptor
It looked like
@JdbcTransaction // connection is obtained from the DS set to thread
local
public void doStuff(){
Connection con = connectionProvider.get(); // connection
retrieved from TL
....
} // connection is properly closed(returned to CP) in any situation
If you tried to obtain a Connection outside @JdbcTransaction you'd get
an error.
I also had @Retry(times=3,delay=2) on the methods but that is another
story.
HTH
Cheers
Alen
On Feb 28, 4:01 am, Karthik Krishnan <[email protected]> wrote:
> Hi All,
>
> In our application, we are slowly migrating to Guice from no DI but we
> have hit a little bit of a road block. In our application, we use
> CallableStatement to make database calls and not any persistence API.
> Is there any guice based application that we can use for transactional
> support. I know that warp api is used to support Hibernate, JPA and
> and DB4Objects.
>
> A post on Stack
> Overflowhttp://stackoverflow.com/questions/2347384/guice-jdbc-and-managing-da...
> did not return any answers as yet. Dhanji's
> blogshttp://www.jroller.com/dhanji/
> andhttp://rethrick.wordpress.com/did not help with that either.
>
> Has any one done any plain jdbc set up with Guice?
>
> Thanks,
>
> Kartik
--
You received this message because you are subscribed to the Google Groups
"google-guice" 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/google-guice?hl=en.