You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@ignite.apache.org by Dmitriy Setrakyan <ds...@apache.org> on 2015/02/28 09:28:07 UTC

CacheStoreSession

Hello Igniters,

I have a question about CacheStoreSession. I am looking at
CacheJdbcPersonStore and it looks like the session can be null? Is it the
case or simply bad code?

If it can be null, please let me know why and when.

D.

Re: CacheStoreSession

Posted by Dmitriy Setrakyan <ds...@apache.org>.
In the "Persistent Store" documentation I have tried the API changes I
suggested, and I think it looks good and consistent:
http://apacheignite.readme.io/v1.0/docs/persistent-store

Would be nice if we could make these changes in sprint-2. They are very
minimal.

I have also asked Andrey N and Alexey K to document the automatic DB schema
integration, which is a big differentiating feature for Ignite.

Hopefully we will have complete Data Grid documentation next week.

D.

On Sat, Feb 28, 2015 at 10:03 AM, Dmitriy Setrakyan <ds...@apache.org>
wrote:

> I am looking at the store and how it interacts with the session and think
> we should make some changes:
>
> 1. There is no need to have a HashMap for session properties. We can just
> have attach(Object) and getAttached(). If user wants to attach a HashMap
> there, he still can.
>
> 2. I don't think CacheStore.txEnd() method is correct. We should call it
> CacheStore.sessionEnd(). For non-transactional operations, this method
> should be invoked after each call, and for transactional operations, it
> should be invoked only after transaction completed.
>
> 3. I also have added isWithinTransaction() method to the session for
> convenience.
>
> I think the above change will allow us to have the same session semantics
> between transactional and non-transactional caches.
>
> Thoughts?
>
> D.
>
> On Sat, Feb 28, 2015 at 5:15 AM, Semyon Boikov <sb...@gridgain.com>
> wrote:
>
>> Cache store session can not be null, I think we need to review all session
>> usages and remove null checks.
>>
>> On Sat, Feb 28, 2015 at 11:28 AM, Dmitriy Setrakyan <
>> dsetrakyan@apache.org>
>> wrote:
>>
>> > Hello Igniters,
>> >
>> > I have a question about CacheStoreSession. I am looking at
>> > CacheJdbcPersonStore and it looks like the session can be null? Is it
>> the
>> > case or simply bad code?
>> >
>> > If it can be null, please let me know why and when.
>> >
>> > D.
>> >
>>
>
>

Re: CacheStoreSession

Posted by Dmitriy Setrakyan <ds...@apache.org>.
I am looking at the store and how it interacts with the session and think
we should make some changes:

1. There is no need to have a HashMap for session properties. We can just
have attach(Object) and getAttached(). If user wants to attach a HashMap
there, he still can.

2. I don't think CacheStore.txEnd() method is correct. We should call it
CacheStore.sessionEnd(). For non-transactional operations, this method
should be invoked after each call, and for transactional operations, it
should be invoked only after transaction completed.

3. I also have added isWithinTransaction() method to the session for
convenience.

I think the above change will allow us to have the same session semantics
between transactional and non-transactional caches.

Thoughts?

D.

On Sat, Feb 28, 2015 at 5:15 AM, Semyon Boikov <sb...@gridgain.com> wrote:

> Cache store session can not be null, I think we need to review all session
> usages and remove null checks.
>
> On Sat, Feb 28, 2015 at 11:28 AM, Dmitriy Setrakyan <dsetrakyan@apache.org
> >
> wrote:
>
> > Hello Igniters,
> >
> > I have a question about CacheStoreSession. I am looking at
> > CacheJdbcPersonStore and it looks like the session can be null? Is it the
> > case or simply bad code?
> >
> > If it can be null, please let me know why and when.
> >
> > D.
> >
>

Re: CacheStoreSession

Posted by Semyon Boikov <sb...@gridgain.com>.
Cache store session can not be null, I think we need to review all session
usages and remove null checks.

On Sat, Feb 28, 2015 at 11:28 AM, Dmitriy Setrakyan <ds...@apache.org>
wrote:

> Hello Igniters,
>
> I have a question about CacheStoreSession. I am looking at
> CacheJdbcPersonStore and it looks like the session can be null? Is it the
> case or simply bad code?
>
> If it can be null, please let me know why and when.
>
> D.
>