ignite-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Vladimir Ozerov <voze...@gridgain.com>
Subject Re: work around for problem where ignite query does not include objects added into Cache from within a transaction
Date Mon, 18 Sep 2017 14:05:15 GMT

Looks like you need the feature which is simply not implement in Ignite at
the moment. SELECTs are not transactional and there is not easy way to make
not-yet-committed updates visible to them. Solution 1 doesn't work as there
are not "temporal" caches in Ignite. Not-yet-committed updates are stored
in some internal data structures. Solution 2 would lead to dramatic
performance degradation.

I would suggest you to rethink the whole approach - SELECTs do have any
transactional guarantees at the moment. May be you will be able to split
single transaction into multiple and then run SQL query in the middle.


On Sat, Sep 16, 2017 at 10:17 AM, kotamrajuyashasvi <
kotamrajuyashasvi@gmail.com> wrote:

> Hi
> When a transaction is started and some rows are updated/inserted/deleted in
> a cache which is in transactional mode, And after that when I perform a
> select query, its not reflecting the results from of update/insert/delete
> done before with in the transaction.  I found out that ignite sql does not
> have this functionality yet. But I need a temporary workaround for this
> problem. I thought of two possible solutions. I do not know the feasibility
> of these solutions and also its impacts on performance or functionality.
> Hence I need your help.
> solution 1: Assuming all updates/inserts/deletes with in transaction are
> temporarily stored in some cache, and then flushed to original cache when
> commited or rolledback, Is there any way I could access that cache to
> perform select query on that temporary cache and then decide what rows
> should I include as result of select query.
> solution 2: When ever I start a Transaction, for every original cache, I
> initialize a new dynamic temporary cache which is not in  transactional
> mode[also does not have any persistent store] using 'getOrCreateCache(..)'
> as mentioned in docs. Now within transaction when ever any update/insert
> happens I insert into the corresponding temporary cache. During the select
> query I perform select query on both main and corresponding temporary
> cache.
> Then I take results from both the queries and decide the actual result.I
> also maintain a list of rows/keys deleted within transaction, and during
> select query I will exclude the keys present in this list. During commit I
> sync the temporary caches into original caches. Will creating temporary
> caches for every transaction degrade performance? Is there any way to
> create
> a temporary cache local to transaction or node so that it does not affect
> performance, since Im using temporary cache mainly for performing sql
> queries.
> Please suggest if there are any drawbacks to the above solutions and also
> if
> there are any other workarounds for this problem.
> --
> Sent from: http://apache-ignite-users.70518.x6.nabble.com/

View raw message