Issue Details (XML | Word | Printable)

Key: OPENEJB-383
Type: Sub-task Sub-task
Status: Closed Closed
Resolution: Fixed
Priority: Major Major
Assignee: Manu T George
Reporter: David Blevins
Votes: 0
Watchers: 0
Operations

If you were logged in you would be able to see more operations.
OpenEJB
OPENEJB-370

ENC: persistence-unit-ref

Created: 27/Nov/06 05:02 AM   Updated: 21/Dec/06 03:23 AM
Return to search
Component/s: container system, ejb3 simplified
Affects Version/s: 3.0-beta-1
Fix Version/s: 3.0-beta-1

Time Tracking:
Not Specified

File Attachments:
  Size
Text File Licensed for inclusion in ASF works patch[1]_r485581_OPENEJB-383.patch 2006-12-11 10:39 AM Manu T George 41 kB
Text File Licensed for inclusion in ASF works patch[2]_r485581_OPENEJB-383.patch 2006-12-12 11:27 AM Manu T George 31 kB
Text File Licensed for inclusion in ASF works PersistenceUnit.patch 2006-12-07 06:07 PM Manu T George 42 kB

Resolution Date: 21/Dec/06 03:23 AM


 All   Comments   Work Log   Change History   Subversion Commits      Sort Order: Ascending order - Click to sort in descending order
David Blevins added a comment - 27/Nov/06 05:18 AM
see:
org.apache.openejb.assembler.classic.JndiEncBuilder
org.apache.openejb.assembler.classic.JndiEncInfo
org.apache.openejb.jee.JndiConsumer
org.apache.openejb.alt.config.EjbJarInfoBuilder

org.apache.openejb.test.entity.cmp.CmpJndiEncTests
org.apache.openejb.test.entity.bmp.BmpJndiEncTests
org.apache.openejb.test.stateless.StatelessJndiEncTests
org.apache.openejb.test.stateless.StatefulJndiEncTests

Manu T George added a comment - 07/Dec/06 06:07 PM
Hi David,
       I have attached a patch. I used a different logic for path resolution. This is because on going through the spec I found that the paths should be relative to the jar containing the ejb and not the ear. ref 16.10.2

The Application Assembler specifies the path name of the root of the referenced persistence
unit and appends the name of the persistence unit separated from the path name by # . The path name is
relative to the referencing application component jar file. In this manner, multiple persistence units with
the same persistence unit name may be uniquely identified when persistence unit names cannot be
changed.



Manu T George added a comment - 07/Dec/06 06:16 PM
Example from the spec

For example,
...
<enterprise-beans>
<session>
...
<ejb-name>InventoryManagerBean</ejb-name>
<ejb-class>
com.wombat.empl.InventoryManagerBean
</ejb-class>
...
<persistence-unit-ref>
<description>
Persistence unit for the inventory management
application.
</description>
<persistence-unit-ref-name>
persistence/InventoryAppDB
</persistence-unit-ref-name>
<persistence-unit-name>
../lib/inventory.jar#InventoryManagement
</persistence-unit-name>
</persistence-unit-ref>
...
</session>
</enterprise-beans>

Here if the path is relative to the EAR we will never have to give ../ as all paths will start from the ear root. Also only the jars in a single EAR are required to be referenced so we will not have to give ../ at all.


Manu T George added a comment - 11/Dec/06 10:39 AM
patch[1]_r485581_OPENEJB-383.patch

This patch fixes issues with the previous one which caused test failures. All the tests are passing with this patch. Pls use this and not the other one

Manu T George added a comment - 12/Dec/06 11:27 AM
Patch with the tests as instructed by David B

Dain Sundstrom added a comment - 21/Dec/06 03:23 AM
Thanks for the patches Manu T George.