Skip to main content
Jump to: navigation, search


Revision as of 13:10, 25 October 2010 by (Talk | contribs) (Proposed Config)

Session Type

The property to set the Session type, such as using a DatabaseSession should not be, "eclipselink.jdbc.single-connection", but "eclipselink.session.type". For SessionBroker, this should be of type "SessionBroker", "DatabaseSession" could also be supported, the default would be "ServerSession", but other types could be supported, including a user defined class "<package>.<class>". 13:54, 25 October 2010 (UTC)


We should not have two (or 5??) different ways to configure this. Only a single logical way. The user should define a persistence unit for each ServerSession and another for the SessionBroker that lists the dependent persistence units. 13:54, 25 October 2010 (UTC)

The property names should make sense, not be "". Should be "eclipselink.session.dependents"="pu1, pu2". 13:54, 25 October 2010 (UTC)

This feature should be developed in 2 stages. Stage 1: Update JPA to use DatabaseSessionImpl, define SessionBroker from two independent persistence units. Stage 2: Support cross persistence unit relationships. 13:54, 25 October 2010 (UTC)

JPA Configuration Example

Although originally I had been assuming we would have a persistence unit per data source with a composite data source it does make container managed JPA support challenging. Even more so when we add support for simple configuration of relationships that go between tables in different data sources.

Proposed Config

Within the persistence.xml a secondary data source is defined. This DS couldne JTA, non--JTA, or a native JDBC connection pool.

<persistence-unit name="employee" transaction-type="JTA">
                <!-- Implicitly define a secondary data source named 'addr-ds' -->
		<property name="eclipselink.jta-data-source.addr-ds" value="addrDS"/>

Within the specified or defaulted EclipseLink ORM xml the data source for entity types not stored in the default DS can be specified.

<entity class="eclipselink.example.jpa.employee.model.Employee" />
<entity class="eclipselink.example.jpa.employee.model.Address" data-source="addr-ds" />

Back to the top