[
Date Prev][
Date Next][
Thread Prev][
Thread Next][
Date Index][
Thread Index]
[
List Home]
RE: [eclipselink-users] DatabaseException jdbc4.CommunicationsException - try SessionCustomizer
|
Mathias,
Hi, If you need to do something in JPA that does not have a property available - try a SessionCustomer and put the custome example java code you mentioned into this class.
See the following JPA example where we had to change the lookupType on the JNDI connector to STRING_LOOKUP instead of Composite.
http://wiki.eclipse.org/EclipseLink/Examples/JPA/JBoss_Web_Tutorial#Create_J2EE_application
persistence.xml property:
<property name="eclipselink.session.customizer" value="org.eclipse.persistence.example.unified.integration.JPAEclipseLinkSessionCustomizer"/>
Your Customizer:
import org.eclipse.persistence.internal.sessions.factories.SessionCustomizer;
public class JPAEclipseLinkSessionCustomizer implements SessionCustomizer {
public void customize(Session session) throws Exception {
thank you
/michael
-----Original Message-----
From: Mathias Walter [mailto:mathias.walter@xxxxxxx]
Sent: Thursday, June 26, 2008 10:08 AM
To: EclipseLink User Discussions
Subject: [eclipselink-users] DatabaseException
jdbc4.CommunicationsException
Hi,
how can I configure EclipseLink (with persistence.xml) to automatically
reconnect to the database after a CommunicationsException?
I've used autoReconnect=true at the JDBC connection string, but it does not
work.
Unfortunately, the EclipseLink documentation explains only how to set this
with the Workbench or Java API and not via persistence.xml. I don't use the
workbench.
--
Kind regards,
Mathias
_______________________________________________
eclipselink-users mailing list
eclipselink-users@xxxxxxxxxxx
https://dev.eclipse.org/mailman/listinfo/eclipselink-users