Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [eclipselink-dev] Bug 328404 - JPA Persistence Unit Composition

Correction:
Composite's predeploy searches <jar-files> using the passed with puInfo classloader for persistence.xml files (the same way Eclipselink does in SE case) - and all found persistence units are deemed to be composite members.


On 5/18/2011 9:54 AM, Shaun Smith wrote:
Hi Andrei,

First one point, the design doc wiki page makes no mention of
@CompositeMember. Can you add something?
The wiki doc will be extensively updated shortly.


Secondly, is there any API to dynamically add a "jarfile" to a composite
(probably pre-login)?
Absolutely not. All the jar files should be known at predeploy time -
way before the session is even created.

It's no different at all from the regular (non composite) persistence
unit: the spec. requires that the classes listed in <jar-file> elements
should be loaded.
That's all that composite needs, too.
Composite's predeploy searches the class loader for persistence.xml
files (the same way Eclipselink does in SE case) - and all found
persistence units are deemed to be composite members.
I quote "jarfile" because I'm thinking of the OSGi
case in which a jar is a bundle. In an OSGi environment configuration is
typically done via what bundles are deployed. In an OSGi model, a
composite member PU would be detected (by some agent like that provided
by Gemini JPA) and registered with the composite rather than listed
statically in the composite PU's persistence.xml. In the OSGi model, you
would not declare statically using <jar-file> what the composite members
were but would rather have the members identify themselves as
contributing to the composite PU, probably via a manifest header.

My thinking is that if there is sufficient API it should be possible for
Gemini JPA to configure the composite PU with detected members. The
scope of this work is outside EclipseLink but providing API to support
this kind of extension should be in scope.

Shaun

On 17/05/2011 8:03 PM, Andrei Ilitchev wrote:
Patch is ready for review.
https://bugs.eclipse.org/bugs/show_bug.cgi?id=328404

The patch adds @CompositeMember annotation and xml support.

A CompositeMember annotation is ignored unless is in composite member
persistence unit.
It may be used in conjunction with a ElementCollection and
CollectionTable annotations.
It should be used if target type is a primitive type and CollectionTable
designates the table that belongs to composite member persistence unit
other than the source composite member persistence unit.
That allows the source and target to be mapped to different databases.

Thanks,
Andrei

On 5/16/2011 6:58 PM, Andrei Ilitchev wrote:
The patch is ready for review.
https://bugs.eclipse.org/bugs/show_bug.cgi?id=328404

Added support for connection properties for composite member
persistence
unit.

In the same way as PersistenceUnitProperties.COMPOSITE_UNIT_PROPERTIES
used to pass member-specific properties to createEMF method now is
possible to pass connection properties (to be processed by members) to
createEM method.
Tests are in composite.advanced.EntityManagerJUnitTestSuite:
testConnectionPolicy;
testConnectionPolicySetProperty;
testNonPooledConnection;
testExclusiveIsolatedLeaksConnectionOnClear.

Thanks,
Andrei

On 5/11/2011 11:08 AM, Andrei Ilitchev wrote:
Checked Patch Eclipse jpa tests launch files into trunk.

Test only patch: added to Eclipse jpa test launch files composite
models' jars.

Thanks,
Andrei
On 5/10/2011 9:03 PM, Andrei Ilitchev wrote:
Patch for composite member using sessions.xml

A simple patch in EntityManagerSetupImpl class: composite persistence
unit always uses its puName as session name. However SESSION_NAME
specified in properties should be used to read correct session from
sessions.xml.

Checked the patch into trunk.

On 5/9/2011 3:08 PM, Andrei Ilitchev wrote:
Correction to static weaving patch is ready for review.

- Following Tom's review introduced a new class to be passed to
EntityManagerSetupImpl (instead of StaticWeaveClassTransformer);
- Corrected problem with static weaving in case sessions.xml is
used.

Thanks,
Andrei

On 5/4/2011 5:39 PM, Andrei Ilitchev wrote:
Checked patch to fix composite persistence unit static weaving into
trunk.
EntityManagerSetupImpl.predeploy method now used for static
weaving,
too.
In this case StaticWeaveClassTransformer is set into emSetupImpl to
indicate that predeploy will be used for static weaving, also
passes
logging parameters.
Also fix to allow persistebce unit to read sessionBroker from
sessions.xml.
Note that such persistence unit is NOT a composite.

Code review by Tom is pending.

Thanks,
Andrei

On 4/27/2011 3:43 PM, Andrei Ilitchev wrote:
Reviewed by James.

Checked in the updated patch into trunk.

If a bunch of new tests fail with connection exceptions,
make sure to specify property
single.db=true
in your test.properties file or system properties.
In that case all composite members will use the same default data
base.

Otherwise specify db2.* and db3.* properties.
For details see eclipselink.jpa.test\test.properties
and / or
org.eclipse.persistence.testing.framework.junit.JUnitTestCaseHelper

class.

The new tests are:
org.eclipse.persistence.testing.tests.jpa.composite.advanced.EntityManagerJUnitTestSuite








and
org.eclipse.persistence.testing.tests.jpa.xml.composite.advanced.EntityMappingsAdvancedJUnitTestCase









The latter test could run with to different persistence units
(using
the
same
classes): "xml-composite-advanced" and
"xml-extended-composite-advanced"
(which
uses eclipselink-orm.xml).
By default "xml-composite-advanced" is used.
Specify -Dorm.testing=eclipselink to use
"xml-extended-composite-advanced".

Note that because both pus use the same classes they should never
both
appear
on the same classpass.

"xml-composite-advanced" defined in
eclipselink-xml-composite-advanced-model.jar
and has members
eclipselink-xml-composite-advanced-model-member_1.jar
eclipselink-xml-composite-advanced-model-member_2.jar
eclipselink-xml-composite-advanced-model-member_3.jar

"xml-extended-composite-advanced" defined in
eclipselink-xml-extended-composite-advanced-model.jar
and has members
eclipselink-xml-extended-composite-advanced-model-member_1.jar
eclipselink-xml-extended-composite-advanced-model-member_2.jar
eclipselink-xml-extended-composite-advanced-model-member_3.jar

Usually the default one ("xml-composite-advanced") is run with all
other
tests
in TestingBrowser (CMP3TestAllRunModel) or FullRegressionTestSuite
and
the
extended one is run separately.

On 4/26/2011 6:50 PM, Andrei Ilitchev wrote:
https://bugs.eclipse.org/bugs/show_bug.cgi?id=328404

The patch is ready for review.
Please send any feedback you may have.

The corresponding document
http://wiki.eclipse.org/EclipseLink/DesignDocs/328404_new
will be extended shortly.

Thanks,

Andrei
_______________________________________________
eclipselink-dev mailing list
eclipselink-dev@xxxxxxxxxxx
https://dev.eclipse.org/mailman/listinfo/eclipselink-dev
_______________________________________________
eclipselink-dev mailing list
eclipselink-dev@xxxxxxxxxxx
https://dev.eclipse.org/mailman/listinfo/eclipselink-dev
_______________________________________________
eclipselink-dev mailing list
eclipselink-dev@xxxxxxxxxxx
https://dev.eclipse.org/mailman/listinfo/eclipselink-dev
_______________________________________________
eclipselink-dev mailing list
eclipselink-dev@xxxxxxxxxxx
https://dev.eclipse.org/mailman/listinfo/eclipselink-dev
_______________________________________________
eclipselink-dev mailing list
eclipselink-dev@xxxxxxxxxxx
https://dev.eclipse.org/mailman/listinfo/eclipselink-dev
_______________________________________________
eclipselink-dev mailing list
eclipselink-dev@xxxxxxxxxxx
https://dev.eclipse.org/mailman/listinfo/eclipselink-dev
_______________________________________________
eclipselink-dev mailing list
eclipselink-dev@xxxxxxxxxxx
https://dev.eclipse.org/mailman/listinfo/eclipselink-dev

--
Oracle <http://www.oracle.com>
Shaun Smith | Principal Product Manager
Phone: +1.905.502.3094 | Mobile: +1.416.558.6244
Oracle Fusion Middleware, TopLink
ORACLE Canada | 100 Milverton Drive, Mississauga, Ontario | L5R 4H1
Green Oracle <http://www.oracle.com/commitment> Oracle is committed to
developing practices and products that help protect the environment



_______________________________________________
eclipselink-dev mailing list
eclipselink-dev@xxxxxxxxxxx
https://dev.eclipse.org/mailman/listinfo/eclipselink-dev
_______________________________________________
eclipselink-dev mailing list
eclipselink-dev@xxxxxxxxxxx
https://dev.eclipse.org/mailman/listinfo/eclipselink-dev


Back to the top