This topic has been locked.
4 replies Latest Post - 2012-09-25T20:38:58Z by wiedela
Pinned topic Grid is firing 2 transactionEnd event for each insert
Answered question This question has been answered.
Unanswered question This question has not been answered yet.
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 110000D4XK1485 PostsACCEPTED ANSWER
Re: Grid is firing 2 transactionEnd event for each insert2012-09-13T16:55:25Z in response to wiedelaHello 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?
Re: Grid is firing 2 transactionEnd event for each insert2012-09-24T22:50:36Z in response to SystemAdminEric,
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.
jhanders 1200009V3S251 PostsACCEPTED ANSWER
Re: Grid is firing 2 transactionEnd event for each insert2012-09-24T23:27:21Z in response to wiedelaIf 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,