ignite-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Alexei Scherbakov <alexey.scherbak...@gmail.com>
Subject Re: listening for events on transactions
Date Wed, 01 Jun 2016 07:48:17 GMT
Hi,

I think the documentation is not very precise on tx topic.
Currently where is no way to listen for transaction events.
The only exception is CacheStoreSessionListener interface which works in
conjunction with CacheStore.
I suppose you can implement "fake" CacheStore and track transaction
activity in corresponding methods.
What's your final goal?


2016-05-31 22:49 GMT+03:00 limabean <drobin1437@gmail.com>:

> Hi,
>
> The Ignite documentation implies that listeners can be set on transactions:
>
> "IgniteTransactions interface contains functionality for starting and
> completing transactions, as well as subscribing listeners or getting
> metrics."
> http://apacheignite.gridgain.org/v1.6/docs/transactions#ignitetransactions
>
>
> However, when I look at the interfaces/classes, it is not clear to me how
> to
> set transaction listeners.
> The behavior I am looking for is the following:
>
> I'd like to make a call like this:
> IgniteTransactionSubsystem.registerListener(myListener...)
>
> When a transaction commits, I would like to have the listener notified
> (callback) with the full contents of the transaction, even if it spanned
> multiple caches....or at a minimum provide the cache keys and cache names
> that were updated in a transaction.
>
> I looked at the CacheJdbcStoreSessionListener example and saw this piece of
> code in the sample persistence code:
> // Configure JDBC session listener.
>             cacheCfg.setCacheStoreSessionListenerFactories(new
> Factory<CacheStoreSessionListener>() {
>                 @Override public CacheStoreSessionListener create() {
>                     CacheJdbcStoreSessionListener lsnr = new
> CacheJdbcStoreSessionListener();
>
>
>
> lsnr.setDataSource(JdbcConnectionPool.create("jdbc:h2:tcp://localhost/mem:ExampleDb",
> "sa", ""));
>
>                     return lsnr;
>                 }
>             });
>
> but it wasn't clear to me how these were supposed to work if they were the
> correct way to listen for transaction.commits.
>
> Continuous queries appear to offer event capability, but it isn't clear how
> they work with transactions.
>
> Thanks for the clarifications/help on how to do transaction listeners.
>
>
>
>
> --
> View this message in context:
> http://apache-ignite-users.70518.x6.nabble.com/listening-for-events-on-transactions-tp5346.html
> Sent from the Apache Ignite Users mailing list archive at Nabble.com.
>



-- 

Best regards,
Alexei Scherbakov

Mime
View raw message