ignite-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From kotamrajuyashasvi <kotamrajuyasha...@gmail.com>
Subject work around for problem where ignite query does not include objects added into Cache from within a transaction
Date Sat, 16 Sep 2017 07:17:21 GMT
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/

Mime
View raw message