Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
[eclipselink-dev] How to wrap the connection under EclipseLink

All -

I'm trying to figure out a way to wrap the connection that is underlying EclipseLink and I am hoping to get some suggestions if I'm on the right track. I found a SO post[1] that details a viable approach that uses a SessionCustomizer. This approach works for my scenario, but I'm looking for another option as a given PU can only have a single customizer. 

I found that I can implement an EventListener and inject my own Connector into the DatabaseSession login. The problem with this approach is that after setting my listener I needed to log the session out and then back in so that my Connector gets called. Ie:

ServerSession ss = ((EntityManagerFactoryImpl)emf).getServerSession();
ss.getEventManager().addListener(new MySessionEventListener());

This approach seems wasteful at best. My fear is that the logout/login calls has some other side effect that I'm unaware of.


Rick Curtis

Back to the top