|
Re: JPA Partitioning and Spring [message #789183 is a reply to message #788543] |
Thu, 02 February 2012 17:57 |
|
You define the additional connection pools using persistence unit properties,
"eclipselink.connection-pool.mypool2.nonJtaDataSource"="<jndi-name>"
The connection pool name is referenced in your partitioning policies, so it is independent of the actually DataSource.
If your DataSource cannot be looked up in JNDI, then you can set it directly. You will need to use a SessionCustomizer for this that gets the ConnectionPool from the ServerSession and configures its Connector on its DatabaseLogin.
You can also use EclipseLink's connection pooling.
James : Wiki : Book : Blog : Twitter
|
|
|
|
|
|
Re: JPA Partitioning and Spring [message #789252 is a reply to message #789227] |
Thu, 02 February 2012 19:35 |
Mike Key Messages: 6 Registered: February 2012 |
Junior Member |
|
|
I have seen that you need a SessionCustomizer for JTA data sources used in this way which give the error I'm seeing. As I'm not using a JTA resource I didn't figure I needed that. Taken from EclipseLink documentation here in the Tomcat-Web-Tutorial examples for Eclipselink (sorry forum wouldn't let me post the URL).
In the section regarding Session Customizer. I just want to validate this is still required when using a non-JTA resource.
I guess the better question I could ask is...is it possible using Spring configuration to pass in the JNDI resource to EclipseLink for both of my data sources? Spring has already done the JNDI lookup, but I can't see how I can just pass EclipseLink the data source Spring has configured.
In Spring I am using the EclipseLinkJpaVendorAdapter.
[Updated on: Thu, 02 February 2012 19:38] Report message to a moderator
|
|
|
Re: JPA Partitioning and Spring [message #793912 is a reply to message #789252] |
Wed, 08 February 2012 18:39 |
|
I think you still needs to use a SessionCustomizer for JNDI on Tomcat. I think you need to set the lookup type on the JNDIConnector.
((JDNIConnector)session.getLogin().getConnector()).setLookupType(JDNIConnector.STRING_LOOKUP)
Please log/vote for the bug on this. There should be a way to use string lookup with using a customizer.
James : Wiki : Book : Blog : Twitter
|
|
|
Powered by
FUDForum. Page generated in 0.45028 seconds