ignite-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Denis Magda <dma...@gridgain.com>
Subject Re: Pre Hook before actual Ignite commit
Date Thu, 16 Jun 2016 22:07:06 GMT
Hi,

If I understand your use case properly you want all the updates that happen inside of an Ignite
transaction to happen inside of a single DB transaction on remote nodes. Is it so?

If yes then you CacheStoreSessionListener interface [1] is what you’re looking for.
In particular since you’re using Spring TX management you should give a try to CacheSpringStoreSessionListener
[2].
To see how all this works in practice refer to the following example [3].

However, makes sure that your persistent store is used in the write-though mode.

[1] https://ignite.apache.org/releases/1.6.0/javadoc/org/apache/ignite/cache/store/CacheStoreSessionListener.html
<https://ignite.apache.org/releases/1.6.0/javadoc/org/apache/ignite/cache/store/CacheStoreSessionListener.html>
[2] https://ignite.apache.org/releases/1.6.0/javadoc/org/apache/ignite/cache/store/spring/CacheSpringStoreSessionListener.html
<https://ignite.apache.org/releases/1.6.0/javadoc/org/apache/ignite/cache/store/spring/CacheSpringStoreSessionListener.html>
[3] https://github.com/apache/ignite/tree/master/examples/src/main/java/org/apache/ignite/examples/datagrid/store/spring

—
Denis

> On Jun 16, 2016, at 7:34 PM, amitpa <amitpa@nrifintech.com> wrote:
> 
> Something like a Spring TransactionSynchornizationmanager. But using that
> will not work, because it workds for the current node, and Ignite can choose
> to do the final commit in other JVMs.
> 
> My problem is that I have 4 caches with Write Through. They use Spring
> Transactions to do JDBC updates/inserts. However if the transaction gets
> committed from other node, each write to JDBC creates a new Transaction as
> no transaction exists when it gets called. Is there any way to initiate a
> transaction before  Ignite calls the write behind stores so that all
> existing calls have a transaction and do not create their own.
> 
> 
> 
> --
> View this message in context: http://apache-ignite-users.70518.x6.nabble.com/Pre-Hook-before-actual-Ignite-commit-tp5679p5685.html
> Sent from the Apache Ignite Users mailing list archive at Nabble.com.


Mime
View raw message