Resource adapter connection question.

84 views
Skip to first unread message

pdelanauze

unread,
Oct 29, 2009, 12:17:01 PM10/29/09
to Hazelcast
I'm looking at the example posted here concerning integration into a
J2EE container. I have tried to plug the RA ( which, btw, has an
invalid ra.xml file, to which i have a patch that i can provide )
inside glassfish without success, yet.

So, looking at the example posted here:
http://code.google.com/docreader/#p=hazelcast&s=hazelcast&t=JEEIntegration

I dont understand how hazelcast leverages the resource adapter to do
the read / writes. It seems a little off that the queue / map is
obtained before a ConnectionFactory establishes a connection. How does
it reference the connection object to access hazelcast ? Am i mis-
understanding something ?
Are there any examples related to ResourceAdapter usage within an app
server ?

Furthermore i am experiencing an issue related to transactions. There
are JPA transactions i need to manage as well as the hazelcast ones.
Since hazelcast does not yet support XA , we need to go local, but
havent yet gotten this configuration working, that's another topic
though...

Thanks for any input...
And great work guys, keep it up

Talip Ozturk

unread,
Nov 3, 2009, 9:38:54 AM11/3/09
to haze...@googlegroups.com
Hi Patrick,

Very sorry for the late response. I am not able to keep up with emails somehow.

> I'm looking at the example posted here concerning integration into a
> J2EE container. I have tried to plug the RA ( which, btw, has an
> invalid ra.xml file, to which i have a patch that i can provide )
> inside glassfish without success, yet.

What is your Glassfish version? And your hazelcast version?

> So, looking at the example posted here:
> http://code.google.com/docreader/#p=hazelcast&s=hazelcast&t=JEEIntegration
>
> I dont understand how hazelcast leverages the resource adapter to do
> the read / writes. It seems a little off that the queue / map is
> obtained before a ConnectionFactory establishes a connection. How does
> it reference the connection object to access hazelcast ? Am i mis-
> understanding something ?

Very good question. This actually same when you are using Hazelcast
Transaction too; you can obtain your queue/map first then you can
start a transaction and commit. Same goes for the ConnectionFactory..

The idea here is that a JTA transaction is tied to a Hazelcast
transaction via JCA connection. So then question becomes how come I
can obtain queue/map before starting a transaction and still have the
queue/map transaction aware...

The simple answer is that each put/remove/get/poll/offer/etc. call is
transaction aware. Transaction information is set to the ThreadContext
of Hazelcast. so when you do map.put (k,v) for example call will check
if the ThreadContext (ThreadLocal variable) has a valid transaction,
if so then the call is transactional. Does it make sense?

> Are there any examples related to ResourceAdapter usage within an app
> server ?

Here is how it is configured for JBoss:
http://code.google.com/docreader/#p=hazelcast&s=hazelcast&t=JEEIntegrationJBossSample

> Furthermore i am experiencing an issue related to transactions. There
> are JPA transactions i need to manage as well as the hazelcast ones.
> Since hazelcast does not yet support XA , we need to go local, but
> havent yet gotten this configuration working, that's another topic
> though...

I need more info for this.

Regards,
-talip

Talip Ozturk

unread,
Nov 4, 2009, 9:22:59 AM11/4/09
to haze...@googlegroups.com
Patrick,

I was able reproduce the JCA problem on Glassfish v3 and created an
issue for it.
http://code.google.com/p/hazelcast/issues/detail?id=158

I just fixed it and wrote a documentation for deploying it.
http://code.google.com/docreader/#p=hazelcast&s=hazelcast&t=JEEIntegrationGlassfishSample

Please download the latest snapshot (i just published it with the fix)
and then follow the documentation to deploy it.

-talip

Reply all
Reply to author
Forward
0 new messages