You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomee.apache.org by Ravindranath Akila <ra...@gmail.com> on 2012/07/01 21:00:43 UTC

Re: OpenEJB + HBase + Datanucleus + JPA - Problem when TomEE closing entity manager

Gave TomEE 1.0.0 a try, but I get a NPE from Datanucleus with no other
message. I will try debugging further.

Is it mandatory that the jta-data-source and non-jta-data-source be defined
on persistence.xml? If so, it is also compulsory that I specify the same on
openejb.xml(tomee.xml)?

I am unable to make an entry on openejb.xml since there is no such HBase
driver available as far as I know(the one availabe is an alpha release).
Datanucleus gives it's own data source implementation.

Basically, I am not sure how the persistence.xml is taken up by a Java EE
server. Is it that the server will read the persistence.xml, find the
provider and hand it over the jta and non-jta data sources? Can the
provider do its own independent hooking up with the database and still be
compatible with container managed transactions?

Sorry if I am overloading you with questions. Just that I am eager to see
HBase running with JPA support on TomEE :-)

As I was busy trying to get a newer openejb version running, I was unable
to write a simple app to reproduce the error. I will send one in soon.
On Jun 30, 2012 11:37 PM, "Romain Manni-Bucau" <rm...@gmail.com>
wrote:

> I want to look datanucleus code so any simple unit test is enough. I can
> install hbase ;)
> Le 30 juin 2012 15:33, "Ravindranath Akila" <ra...@gmail.com>
> a
> écrit :
>
> > Hi Romain,
> >  I will give a newer version a try. Hope I don't run into multiple
> > independent issues :-)
> >  To provide the project for you to investigate is not hard but I have to
> > see to that you can get it up and running easily. Having HBase in the
> scene
> > makes complicated.
> >  Would it be better if I provide a pom.xml with the entity enhancer
> plugin
> > so that you can run any project with it to see how Datanucleus and HBase
> > does against it?
> >  Basically our code has no TomEE specific stuff and is standard JEE so I
> > can inline any outcome you get.
> >
> > Thanks a lot Romain :-)
> >
>

Re: OpenEJB + HBase + Datanucleus + JPA - Problem when TomEE closing entity manager

Posted by Ravindranath Akila <ra...@gmail.com>.
Datancleus HBase datastore does not support transactions yet. Unless one
drops JEE transaction support and manually handle rollbacks, this approach
is not right at least for now.

For anybody looking for a NoSQL JPA approach, trying MongoDB with eclipse
might work. Yet, transaction support needs to be checked. (There are also a
few minor limitations like "IN support)

Thanks a lot Romain :-)

Re: OpenEJB + HBase + Datanucleus + JPA - Problem when TomEE closing entity manager

Posted by Romain Manni-Bucau <rm...@gmail.com>.
Add openejb-core as provided dep and use OpenEJB.getTransactionManager()

- Romain
Le 2 juil. 2012 05:56, "Ravindranath Akila" <ra...@gmail.com> a
écrit :

> For the JTA Locatior, for JNDI lookup, I should give:
>
> java:openejb/TransactionManager (if outside a bean)
> java:comp/TransactionManager (if inside a bean)
>
> Am I correct?
>
>
> (Debug info if needed:
> this = {org.datanucleus.jta.CustomJNDITransactionManagerLocator@269}
> jndiLocation = {java.lang.String@475}"java:openejb/TransactionManager"
> clr = {org.datanucleus.JDOClassLoaderResolver@355}"ClassLoaderResolver:
> primary=java.lang.ThreadLocal@c0cac8 pmContextLoader=null
> runtimeLoader=null registeredLoader=null"
> e = {javax.naming.NameNotFoundException@742
> }"javax.naming.NameNotFoundException:
> Name \"openejb/TransactionManager\" not found."
> resolvedName = null
> resolvedObj = null
> remainingName = null
> rootException = null
> detailMessage = {java.lang.String@749}"Name \"openejb/TransactionManager\"
> not found."
> cause = {javax.naming.NameNotFoundException@742
> }"javax.naming.NameNotFoundException:
> Name \"openejb/TransactionManager\" not found."
> stackTrace = null
> ctx = {javax.naming.InitialContext@463}
> myProps = {java.util.Hashtable@477} size = 2
> [0] = {java.util.Hashtable$Entry@497}"java.naming.factory.initial" ->
> "org.apache.naming.java.javaURLContextFactory"
> [1] = {java.util.Hashtable$Entry@505}"java.naming.factory.url.pkgs" ->
> "org.apache.naming:org.apache.openejb.core.ivm.naming"
> defaultInitCtx = {org.apache.naming.SelectorContext@470}
> env = {java.util.Hashtable@477} size = 2
> [0] = {java.util.Hashtable$Entry@497}"java.naming.factory.initial" ->
> "org.apache.naming.java.javaURLContextFactory"
> [1] = {java.util.Hashtable$Entry@505}"java.naming.factory.url.pkgs" ->
> "org.apache.naming:org.apache.openejb.core.ivm.naming"
> sm = {org.apache.naming.StringManager@485}
> initialContext = true
> gotDefault = true
> )
>

Re: OpenEJB + HBase + Datanucleus + JPA - Problem when TomEE closing entity manager

Posted by Ravindranath Akila <ra...@gmail.com>.
For the JTA Locatior, for JNDI lookup, I should give:

java:openejb/TransactionManager (if outside a bean)
java:comp/TransactionManager (if inside a bean)

Am I correct?


(Debug info if needed:
this = {org.datanucleus.jta.CustomJNDITransactionManagerLocator@269}
jndiLocation = {java.lang.String@475}"java:openejb/TransactionManager"
clr = {org.datanucleus.JDOClassLoaderResolver@355}"ClassLoaderResolver:
primary=java.lang.ThreadLocal@c0cac8 pmContextLoader=null
runtimeLoader=null registeredLoader=null"
e = {javax.naming.NameNotFoundException@742}"javax.naming.NameNotFoundException:
Name \"openejb/TransactionManager\" not found."
resolvedName = null
resolvedObj = null
remainingName = null
rootException = null
detailMessage = {java.lang.String@749}"Name \"openejb/TransactionManager\"
not found."
cause = {javax.naming.NameNotFoundException@742}"javax.naming.NameNotFoundException:
Name \"openejb/TransactionManager\" not found."
stackTrace = null
ctx = {javax.naming.InitialContext@463}
myProps = {java.util.Hashtable@477} size = 2
[0] = {java.util.Hashtable$Entry@497}"java.naming.factory.initial" ->
"org.apache.naming.java.javaURLContextFactory"
[1] = {java.util.Hashtable$Entry@505}"java.naming.factory.url.pkgs" ->
"org.apache.naming:org.apache.openejb.core.ivm.naming"
defaultInitCtx = {org.apache.naming.SelectorContext@470}
env = {java.util.Hashtable@477} size = 2
[0] = {java.util.Hashtable$Entry@497}"java.naming.factory.initial" ->
"org.apache.naming.java.javaURLContextFactory"
[1] = {java.util.Hashtable$Entry@505}"java.naming.factory.url.pkgs" ->
"org.apache.naming:org.apache.openejb.core.ivm.naming"
sm = {org.apache.naming.StringManager@485}
initialContext = true
gotDefault = true
)

Re: OpenEJB + HBase + Datanucleus + JPA - Problem when TomEE closing entity manager

Posted by Romain Manni-Bucau <rm...@gmail.com>.
Hmm, Driver are just a way to get a connection. That's not linked to JTA.

Cassandra got a sql Driver even if it is a great NoSQL solution so not sure
that's the reason.

In all case providing a jta locator is important (we have the same kind of
stuff with hibernate, openjpa and so on).

Good luck with your tests!

- Romain


2012/7/1 Ravindranath Akila <ra...@gmail.com>

> Thanks! I will try both methods. Meanwhile I found this:
>
> http://www.datanucleus.org/extensions/jta_locator.html
>
> I will try this too.
>
> I think I am missing the point that SQL databases have their own low level
> locks for transactions and this whole NoSQL scenario where ACIDity is
> compromised for availability etc. makes the JTA scenario hard to
> understand. I am assuming this is where the JDBC drivers play a big role.
>
> Thanks for being patient with me Romain :-)
>
> I will revert back failing these three approaches.
> On Jul 2, 2012 12:55 AM, "Romain Manni-Bucau" <rm...@gmail.com>
> wrote:
>
> > Yep,
> >
> > in JTA mode jta-datasource will be used. Persistence.xml datasources are
> > managed by TomEE itself.
> >
> > To define a datasource from a datasource impl (weird to say but i guess
> you
> > understand ;)) you can maybe try @DataSourceDefinition or the datasource
> > XML definition from web.xml?
> >
> > - Romain
> >
> >
> > 2012/7/1 Ravindranath Akila <ra...@gmail.com>
> >
> > > Gave TomEE 1.0.0 a try, but I get a NPE from Datanucleus with no other
> > > message. I will try debugging further.
> > >
> > > Is it mandatory that the jta-data-source and non-jta-data-source be
> > defined
> > > on persistence.xml? If so, it is also compulsory that I specify the
> same
> > on
> > > openejb.xml(tomee.xml)?
> > >
> > > I am unable to make an entry on openejb.xml since there is no such
> HBase
> > > driver available as far as I know(the one availabe is an alpha
> release).
> > > Datanucleus gives it's own data source implementation.
> > >
> > > Basically, I am not sure how the persistence.xml is taken up by a Java
> EE
> > > server. Is it that the server will read the persistence.xml, find the
> > > provider and hand it over the jta and non-jta data sources? Can the
> > > provider do its own independent hooking up with the database and still
> be
> > > compatible with container managed transactions?
> > >
> > > Sorry if I am overloading you with questions. Just that I am eager to
> see
> > > HBase running with JPA support on TomEE :-)
> > >
> > > As I was busy trying to get a newer openejb version running, I was
> unable
> > > to write a simple app to reproduce the error. I will send one in soon.
> > > On Jun 30, 2012 11:37 PM, "Romain Manni-Bucau" <rm...@gmail.com>
> > > wrote:
> > >
> > > > I want to look datanucleus code so any simple unit test is enough. I
> > can
> > > > install hbase ;)
> > > > Le 30 juin 2012 15:33, "Ravindranath Akila" <
> > ravindranathakila@gmail.com
> > > >
> > > > a
> > > > écrit :
> > > >
> > > > > Hi Romain,
> > > > >  I will give a newer version a try. Hope I don't run into multiple
> > > > > independent issues :-)
> > > > >  To provide the project for you to investigate is not hard but I
> have
> > > to
> > > > > see to that you can get it up and running easily. Having HBase in
> the
> > > > scene
> > > > > makes complicated.
> > > > >  Would it be better if I provide a pom.xml with the entity enhancer
> > > > plugin
> > > > > so that you can run any project with it to see how Datanucleus and
> > > HBase
> > > > > does against it?
> > > > >  Basically our code has no TomEE specific stuff and is standard JEE
> > so
> > > I
> > > > > can inline any outcome you get.
> > > > >
> > > > > Thanks a lot Romain :-)
> > > > >
> > > >
> > >
> >
>

Re: OpenEJB + HBase + Datanucleus + JPA - Problem when TomEE closing entity manager

Posted by Ravindranath Akila <ra...@gmail.com>.
Thanks! I will try both methods. Meanwhile I found this:

http://www.datanucleus.org/extensions/jta_locator.html

I will try this too.

I think I am missing the point that SQL databases have their own low level
locks for transactions and this whole NoSQL scenario where ACIDity is
compromised for availability etc. makes the JTA scenario hard to
understand. I am assuming this is where the JDBC drivers play a big role.

Thanks for being patient with me Romain :-)

I will revert back failing these three approaches.
On Jul 2, 2012 12:55 AM, "Romain Manni-Bucau" <rm...@gmail.com> wrote:

> Yep,
>
> in JTA mode jta-datasource will be used. Persistence.xml datasources are
> managed by TomEE itself.
>
> To define a datasource from a datasource impl (weird to say but i guess you
> understand ;)) you can maybe try @DataSourceDefinition or the datasource
> XML definition from web.xml?
>
> - Romain
>
>
> 2012/7/1 Ravindranath Akila <ra...@gmail.com>
>
> > Gave TomEE 1.0.0 a try, but I get a NPE from Datanucleus with no other
> > message. I will try debugging further.
> >
> > Is it mandatory that the jta-data-source and non-jta-data-source be
> defined
> > on persistence.xml? If so, it is also compulsory that I specify the same
> on
> > openejb.xml(tomee.xml)?
> >
> > I am unable to make an entry on openejb.xml since there is no such HBase
> > driver available as far as I know(the one availabe is an alpha release).
> > Datanucleus gives it's own data source implementation.
> >
> > Basically, I am not sure how the persistence.xml is taken up by a Java EE
> > server. Is it that the server will read the persistence.xml, find the
> > provider and hand it over the jta and non-jta data sources? Can the
> > provider do its own independent hooking up with the database and still be
> > compatible with container managed transactions?
> >
> > Sorry if I am overloading you with questions. Just that I am eager to see
> > HBase running with JPA support on TomEE :-)
> >
> > As I was busy trying to get a newer openejb version running, I was unable
> > to write a simple app to reproduce the error. I will send one in soon.
> > On Jun 30, 2012 11:37 PM, "Romain Manni-Bucau" <rm...@gmail.com>
> > wrote:
> >
> > > I want to look datanucleus code so any simple unit test is enough. I
> can
> > > install hbase ;)
> > > Le 30 juin 2012 15:33, "Ravindranath Akila" <
> ravindranathakila@gmail.com
> > >
> > > a
> > > écrit :
> > >
> > > > Hi Romain,
> > > >  I will give a newer version a try. Hope I don't run into multiple
> > > > independent issues :-)
> > > >  To provide the project for you to investigate is not hard but I have
> > to
> > > > see to that you can get it up and running easily. Having HBase in the
> > > scene
> > > > makes complicated.
> > > >  Would it be better if I provide a pom.xml with the entity enhancer
> > > plugin
> > > > so that you can run any project with it to see how Datanucleus and
> > HBase
> > > > does against it?
> > > >  Basically our code has no TomEE specific stuff and is standard JEE
> so
> > I
> > > > can inline any outcome you get.
> > > >
> > > > Thanks a lot Romain :-)
> > > >
> > >
> >
>

Re: OpenEJB + HBase + Datanucleus + JPA - Problem when TomEE closing entity manager

Posted by Romain Manni-Bucau <rm...@gmail.com>.
Yep,

in JTA mode jta-datasource will be used. Persistence.xml datasources are
managed by TomEE itself.

To define a datasource from a datasource impl (weird to say but i guess you
understand ;)) you can maybe try @DataSourceDefinition or the datasource
XML definition from web.xml?

- Romain


2012/7/1 Ravindranath Akila <ra...@gmail.com>

> Gave TomEE 1.0.0 a try, but I get a NPE from Datanucleus with no other
> message. I will try debugging further.
>
> Is it mandatory that the jta-data-source and non-jta-data-source be defined
> on persistence.xml? If so, it is also compulsory that I specify the same on
> openejb.xml(tomee.xml)?
>
> I am unable to make an entry on openejb.xml since there is no such HBase
> driver available as far as I know(the one availabe is an alpha release).
> Datanucleus gives it's own data source implementation.
>
> Basically, I am not sure how the persistence.xml is taken up by a Java EE
> server. Is it that the server will read the persistence.xml, find the
> provider and hand it over the jta and non-jta data sources? Can the
> provider do its own independent hooking up with the database and still be
> compatible with container managed transactions?
>
> Sorry if I am overloading you with questions. Just that I am eager to see
> HBase running with JPA support on TomEE :-)
>
> As I was busy trying to get a newer openejb version running, I was unable
> to write a simple app to reproduce the error. I will send one in soon.
> On Jun 30, 2012 11:37 PM, "Romain Manni-Bucau" <rm...@gmail.com>
> wrote:
>
> > I want to look datanucleus code so any simple unit test is enough. I can
> > install hbase ;)
> > Le 30 juin 2012 15:33, "Ravindranath Akila" <ravindranathakila@gmail.com
> >
> > a
> > écrit :
> >
> > > Hi Romain,
> > >  I will give a newer version a try. Hope I don't run into multiple
> > > independent issues :-)
> > >  To provide the project for you to investigate is not hard but I have
> to
> > > see to that you can get it up and running easily. Having HBase in the
> > scene
> > > makes complicated.
> > >  Would it be better if I provide a pom.xml with the entity enhancer
> > plugin
> > > so that you can run any project with it to see how Datanucleus and
> HBase
> > > does against it?
> > >  Basically our code has no TomEE specific stuff and is standard JEE so
> I
> > > can inline any outcome you get.
> > >
> > > Thanks a lot Romain :-)
> > >
> >
>