Welcome to the new Gigaspaces XAP forum. To recover your account, please follow these instructions.

Ask Your Question
0

Enrolling Sync Remote Operations in a Transaction

Hello,

I have two PUs each of which provides a remote method. The remote method implementations each act on a local space. Each method implementation is transactional using a local transaction manager. I have a non-PU client that calls first one and then the other. They both execute fine, each under its own transaction.

Now I want to execute both of them under the same transaction. I use namespace to create a distributed transaction manager and attach it to the two proxies used by the client to invoke the remote methods. I mark the client method (which is in a bean that is managed by the Spring application context) as @Transactional, and specify annotation-driven transactions in the context file, referring explicitly to the distributed transaction manager I created. As far as I can tell from the documentation:

====== Transactional Execution

Sync remoting supports transactional execution of services. On the client side, if there is an ongoing declarative transaction during the service invocation (a Space based transaction), the service will be executed under the same transaction. The transaction itself is passed to the server and any Space related operations (performed using GigaSpace) will be executed under the same transaction. The transaction lifecycle itself is controlled on the client side (declaratively) and is committed / rolled back only on the client side. (Note, exceptions on the server side will simply propagate to the client side, and will cause a rollback only if the client "decides" so.)

When using broadcast with sync remoting, a declarative distributed transaction must be used and not a local (or JTA one). Also note, the GigaSpace instance that is used internally by the sync remoting invocation must be configured with a transaction manager (as is the case for enabling transaction execution with any other GigaSpace based operation).

this is what I am supposed to do. When I run the client, I see that mahalo starts but the two remote methods execute as before, each under its own independent local transaction.

I also tried switching the transaction managers used by the remote methods to distributed, although each operates on one single-partitioned space. The results are the same except that the two independent transactions under which the two remote method operate are Jini instead of Local.

What am I missing? How do I get the two RMI invocations to execute under a single distributed transaction under the control of my non-PU client?

I'm attaching the code in case you can't spot the problem from the description above.

Thanks for your help.

-Dan h4. Attachments

[TwoPUsWantDistTran.jar|/upfiles/13759709593941289.jar]

{quote}This thread was imported from the previous forum. For your reference, the original is [available here|http://forum.openspaces.org/thread.jspa?threadID=3071]{quote}

asked 2009-05-08 10:57:37 -0500

subuta gravatar image

updated 2013-08-08 09:52:00 -0500

jaissefsfex gravatar image
edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted
0

Third time I have asked essentially the same question, but at least this time I spotted the problem myself. I didn't have the bean that was trying to initiate the distributed transaction set up to be proxied properly by Spring.

Here's hoping I have made that mistake for the final time.

answered 2009-05-11 23:48:39 -0500

subuta gravatar image
edit flag offensive delete link more

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools

1 follower

Stats

Asked: 2009-05-08 10:57:37 -0500

Seen: 124 times

Last updated: May 11 '09