Skip to main content

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

Thanks for the pointer!

On Fri, Jan 23, 2015 at 8:31 AM, andrei ilitchev <andrei.ilitchev@xxxxxxxxxx> wrote:
There is no harm in logout/login.
To avoid reconnection specify session event listener class name in "eclipselink.session-event-listener" pu property.

Thanks,
Andrei

On 1/22/2015 7:00 PM, Rick Curtis wrote:
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());
ss.logout();
ss.login();

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


_______________________________________________
eclipselink-dev mailing list
eclipselink-dev@xxxxxxxxxxx
To change your delivery options, retrieve your password, or unsubscribe from this list, visit
https://dev.eclipse.org/mailman/listinfo/eclipselink-dev


_______________________________________________
eclipselink-dev mailing list
eclipselink-dev@xxxxxxxxxxx
To change your delivery options, retrieve your password, or unsubscribe from this list, visit
https://dev.eclipse.org/mailman/listinfo/eclipselink-dev



--
Rick Curtis

Back to the top