[
Date Prev][
Date Next][
Thread Prev][
Thread Next][
Date Index][
Thread Index]
[
List Home]
Re: [eclipselink-users] OracleDataSource and threading (?) problems
|
David,
Hi,
1) Yes, EclipseLink is able to run in both container-managed (JTA)
and application managed (RESOURCE_LOCAL) modes on any specific full JEE
container.
Also, using a datasource from Tomcat within an SE JPA application
has been tested.
Check that you are specifying the
jta-data-source/non-jta-data-source property and that you are ok with
the fact that the transaction-type defaults to JTA if not specified
-when deployed to the server and RESOURCE_LOCAL when on an SE client -
this will affect whether the datasource or db properties are used - if
they are still specified.
For example, for details on setting up an Oracle datasource on
WebLogic see...
http://wiki.eclipse.org/EclipseLink/Examples/JPA/WebLogic_Web_Tutorial#JNDI_Datasource_Setup
Depending on the container that your datasource is running on - you
will need extra configuration steps. I assume that your datasource is
NOT application managed and that you are using a globally defined
datasource (no need for a deploy).
For example when targeting Tomcat, you will need to reference the
catalina and ds support jars, set your InitialContext factory and
prefixes, modify persistence.xml to use a non-jta-data-source and setup
the datasource on the server.
2) For the NPE's, post the stacktrace and we will advise.
Note: that the default behavior for picking up entities also changes
on/off the server and you may need to specify a combination of <class>
entries and/or <exclude-unlisted-classes> to pickup or fine tune which
entities are picked up.
If you would like examples of how to configure your application for
a specific server, you may refer to the following examples by server.
Most of the examples are using an Oracle JTA datasource.
http://wiki.eclipse.org/EclipseLink/Examples/JPA#JPA_Web_Application_Tutorials
There are specific instructions for running an application managed
datasource for WebLogic
http://wiki.eclipse.org/EclipseLink/Examples/JPA/WLS_AppScoped_DataSource
and in your particular situation, an example SE JPA app that uses
the JTA datasource on Tomcat 6.
http://wiki.eclipse.org/EclipseLink/Examples/JPA/Tomcat_Web_Tutorial#Using_JNDI_outside_the_Tomcat_container_for_J2SE_Applications
For reference here is a RESOURCE_LOCAL SE JPA app that does not use
a datasource.
http://dev.eclipse.org/svnroot/rt/org.eclipse.persistence/trunk/examples/org.eclipse.persistence.example.jpa.server.common.ddlgen/
Also, be aware that Catalina based server will require a
SessionCustomizer that modifies the lookupType on the connector to a
String type, see..
http://wiki.eclipse.org/EclipseLink/Examples/JPA/Tomcat_Web_Tutorial#Session_Customizer
If you post a copy of your persistence.xml as well as your
overriding properties and the stack trace/log we will triage this issue.
- config details (Application server, Database, EclipseLink
version) part of persistence.xml and the logs
- persistence.xml
- property overrides
- application managed *-oracle-ds.xml datasource definition
- globally defined datasource definition
- stacktrace
- some specific example client code if you can (especially if your
client is multi-threaded)
- EclipseLink [EL] logs on FINEST if possible (both Client and
Server if possible)
thank you
/michael
David Parker wrote:
We are using eclipselink in a server application, but there is no
container (j2ee, spring, etc) involved: our persistence environment is
completely application-managed.
The server has a single static EntityManagerFactory, and each serve
thread gets its own EntityManager.
This was all working fine when we were passing the low-level jdbc
properties (driver, url, user, password) in the map to create the
EntityManager, but we started having problems
when we tried to switch to using an OracleDataSource (we want to be
able to take advantage of Oracle RAC eventually).
The code now creates an EntityManager with a single item in the
property map, a pre-constructed DataSource object.
Unfortunately, we are now seeing random NPE's from deep in the
eclipselink stack. It has all the earmarks of a threading problem, but
all that has changed is the use of the DataSource.
Is DataSource usage fully supported in a non-containter environment?
Are there additional configuration steps that need to be taken. Is
anybody using OracleDataSource with eclipselink?
Thanks in advance for any clues.
===========================================
David Parker
david@xxxxxxxxxxxxxx
(401) 263-1782
_______________________________________________
eclipselink-users mailing list
eclipselink-users@xxxxxxxxxxx
https://dev.eclipse.org/mailman/listinfo/eclipselink-users