here how to declare a resource:
1) create a META-INF/foo/service-jar.xml
2) put in:
<ServiceJar>
<ServiceProvider id="my-id"
service="Resource"
type="...Session"
class-name="...SessionUnwrapper">
</ServiceProvider></ServiceJar>
3) implement SessionUnwrapper to unwrap the session
4) declare a resource of type defined in the previous file and
provider="foo:my-id":
<Resource id="bar" type="...Session" provider="foo:my-id"/>
5) use jndi name: openejb/Resource/bar
that's not "easy" but hibernate is not jpa....
i think there is ither way to do so, and i can't get why jndi is
mandatory...
- Romain
2012/6/13 zeeman <[email protected]>
> I like it to be as simple as possible. The first option is easier. Is
> unwrapping the Hibernate session from EMF and setting it in JNDI would be
> done in Java code not xml files?
>
> But I don't see how is this going to work, because when app is deployed the
> EMF will be set. So I have to bind the session factory in JNDI when EMF is
> set. Right?
>
> Could you provide more details place? Some code will help and JNDI value to
> bind sesstion factory with.
>
> --
> View this message in context:
> http://openejb.979440.n4.nabble.com/Tomee-Hibernate-Session-JNDI-tp4655576p4655600.html
> Sent from the OpenEJB User mailing list archive at Nabble.com.
>