Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
RE: [eclipselink-users] DatabaseExceptionjdbc4.CommunicationsException - try SessionCustomizer

Hi Michael,

is there no standard way to activate an autoReconnect or a keep alive?

I don't use JNDI. I'm using the MySQL connector. Why does the MySQL
autoReconnect parameter does not work?

--
Kind regards,
Mathias

> -----Original Message-----
> From: eclipselink-users-bounces@xxxxxxxxxxx 
> [mailto:eclipselink-users-bounces@xxxxxxxxxxx] On Behalf Of 
> MICHAEL.OBRIEN@xxxxxxxxxx
> Sent: Thursday, June 26, 2008 4:31 PM
> To: EclipseLink User Discussions
> Subject: RE: [eclipselink-users] 
> DatabaseExceptionjdbc4.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_Tut
> orial#Create_J2EE_application
> 
> 
> persistence.xml property:
> 
> 	<property name="eclipselink.session.customizer" 
> value="org.eclipse.persistence.example.unified.integration.JPA
> EclipseLinkSessionCustomizer"/>
> 
> 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
> _______________________________________________
> eclipselink-users mailing list
> eclipselink-users@xxxxxxxxxxx
> https://dev.eclipse.org/mailman/listinfo/eclipselink-users



Back to the top