Topic
  • 4 replies
  • Latest Post - ‏2012-09-25T20:38:58Z by wiedela
wiedela
wiedela
19 Posts

Pinned topic Grid is firing 2 transactionEnd event for each insert

‏2012-08-24T14:59:30Z |
I have an ObjectGridEventListener configured within my grid, and every time I insert data, I receive 2 transactionEnd events. The second one is always on Partition 0. How do I not fire the second event and what exactly is happening?
Updated on 2012-09-25T20:38:58Z at 2012-09-25T20:38:58Z by wiedela
  • SystemAdmin
    SystemAdmin
    1485 Posts

    Re: Grid is firing 2 transactionEnd event for each insert

    ‏2012-09-13T16:55:25Z  
    Hello Adam,

    May I get some additional info.

    Is it only transactionEnd events that are getting received twice? Or do transactionBegin events get called twice as well?

    What version of eXtreme Scale are you using?

    Partition 0 is the client. Do you maybe have two ObjectGridEventListeners, one on the client and one on the server?
    Eric
  • wiedela
    wiedela
    19 Posts

    Re: Grid is firing 2 transactionEnd event for each insert

    ‏2012-09-24T22:50:36Z  
    Hello Adam,

    May I get some additional info.

    Is it only transactionEnd events that are getting received twice? Or do transactionBegin events get called twice as well?

    What version of eXtreme Scale are you using?

    Partition 0 is the client. Do you maybe have two ObjectGridEventListeners, one on the client and one on the server?
    Eric
    Eric,
    Sorry for the late reply. We actually had 2 event listeners in our original problem, which was a bookkeeping error on our part. However, we do have another set of weird behavior using listeners again.

    We are currently trying to add event listeners programmatically into one of our grids from another grid. The idea is that we have Grid-A which is a simple data cache and Grid-M which is going to store varied metadata objects. When Grid-M starts, we want to make a connection to Grid-A and add multiple listeners for data. We see where the listener is initialized, when data is added to Grid-A, we don't get the transactionEnd event.

    Again, I'm assuming this is a simple and/or common problem and we are just missing a step, but we are stuck on it so any help is appreciated.

    Thanks
  • jhanders
    jhanders
    260 Posts

    Re: Grid is firing 2 transactionEnd event for each insert

    ‏2012-09-24T23:27:21Z  
    • wiedela
    • ‏2012-09-24T22:50:36Z
    Eric,
    Sorry for the late reply. We actually had 2 event listeners in our original problem, which was a bookkeeping error on our part. However, we do have another set of weird behavior using listeners again.

    We are currently trying to add event listeners programmatically into one of our grids from another grid. The idea is that we have Grid-A which is a simple data cache and Grid-M which is going to store varied metadata objects. When Grid-M starts, we want to make a connection to Grid-A and add multiple listeners for data. We see where the listener is initialized, when data is added to Grid-A, we don't get the transactionEnd event.

    Again, I'm assuming this is a simple and/or common problem and we are just missing a step, but we are stuck on it so any help is appreciated.

    Thanks
    If you are calling to add the ObjectGridEventListener on your client connection ObjectGrid it is only added on the client side, so only events on that client will invoke the ObjectGridEventListener. If you want the server to have the listener, then you would have to use an agent in order to add or potentially remove the ObjectGridEventListner on all the partitions. If partitions move though you will no longer have the listener and it will need to be added back when the replica becomes primary unless you have an LifeCycleListener that queries a map to get the state of the dynamically added listeners or something and adds them during promotion of a replica to primary.

    I hope that helps,

    Jared Anderson
  • wiedela
    wiedela
    19 Posts

    Re: Grid is firing 2 transactionEnd event for each insert

    ‏2012-09-25T20:38:58Z  
    • jhanders
    • ‏2012-09-24T23:27:21Z
    If you are calling to add the ObjectGridEventListener on your client connection ObjectGrid it is only added on the client side, so only events on that client will invoke the ObjectGridEventListener. If you want the server to have the listener, then you would have to use an agent in order to add or potentially remove the ObjectGridEventListner on all the partitions. If partitions move though you will no longer have the listener and it will need to be added back when the replica becomes primary unless you have an LifeCycleListener that queries a map to get the state of the dynamically added listeners or something and adds them during promotion of a replica to primary.

    I hope that helps,

    Jared Anderson
    Jared,
    Yeah, that worked like a charm. Took me about 20 minutes to try what you said with what I had and I got it running.

    Thanks