Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » EMF » [CDO] Session busy indicator
[CDO] Session busy indicator [message #431520] Wed, 15 July 2009 05:21 Go to next message
Egidijus Vaisnora is currently offline Egidijus Vaisnora
Messages: 47
Registered: July 2009
Member
How could I find out that CDO session on *server* is busy?
Idea is that I am closing sessions on server side (let say administrator can kill undesired sessions), however I don't want to
kill a session which is reading something from the client side - just because to avoid possible data corruption on server.
Re: [CDO] Session busy indicator [message #431522 is a reply to message #431520] Wed, 15 July 2009 05:51 Go to previous messageGo to next message
Eike Stepper is currently offline Eike Stepper
Messages: 5514
Registered: July 2009
Senior Member
Egidijus,

Comments below...


Egidijus Vaisnora schrieb:
>
> How could I find out that CDO session on *server* is busy?
Depends on how you define "busy".

The Session class extends Lifecycle, so you can always ask
LifecycleUtil.isActive(session) or register an IListener with it. But:
The SessionManager automatically detects deactivated sessions and
removes them.

> Idea is that I am closing sessions on server side (let say
> administrator can kill undesired sessions),
What means "undesired"? Why don't you prevent undesired sessions from
the beginning? Or can they *become* undesired?

> however I don't want to kill a session which is reading something from
> the client side - just because to avoid possible data corruption on
> server.
I don't think it's possible to corrupt data on the server. Have you
tried it?

Cheers
/Eike

----
http://thegordian.blogspot.com
http://twitter.com/eikestepper
Re: [CDO] Session busy indicator [message #431524 is a reply to message #431522] Wed, 15 July 2009 07:39 Go to previous messageGo to next message
Egidijus Vaisnora is currently offline Egidijus Vaisnora
Messages: 47
Registered: July 2009
Member
Eike,

> Depends on how you define "busy".

busy = no commit is currently running from the client to server

> What means "undesired"? Why don't you prevent undesired sessions from
> the beginning? Or can they *become* undesired?

undesired = session that is supposed to be closed immediately (session management)

> I don't think it's possible to corrupt data on the server. Have you
> tried it?

Actually, I have few reports (I suppose it was working with derby DB), that after similar session closing, model cannot longer
be used - it gives me reason to believe in data corruption. Why do you think that session closing somewhere in the middle of
commit cannot break model?


Eike Stepper wrote:
> Egidijus,
>
> Comments below...
>
>
> Egidijus Vaisnora schrieb:
>> How could I find out that CDO session on *server* is busy?
> Depends on how you define "busy".
>
> The Session class extends Lifecycle, so you can always ask
> LifecycleUtil.isActive(session) or register an IListener with it. But:
> The SessionManager automatically detects deactivated sessions and
> removes them.
>
>> Idea is that I am closing sessions on server side (let say
>> administrator can kill undesired sessions),
> What means "undesired"? Why don't you prevent undesired sessions from
> the beginning? Or can they *become* undesired?
>
>> however I don't want to kill a session which is reading something from
>> the client side - just because to avoid possible data corruption on
>> server.
> I don't think it's possible to corrupt data on the server. Have you
> tried it?
>
> Cheers
> /Eike
>
> ----
> http://thegordian.blogspot.com
> http://twitter.com/eikestepper
>
Re: [CDO] Session busy indicator [message #431525 is a reply to message #431524] Wed, 15 July 2009 07:50 Go to previous messageGo to next message
Eike Stepper is currently offline Eike Stepper
Messages: 5514
Registered: July 2009
Senior Member
Egidijus Vaisnora schrieb:
> Eike,
>
> > Depends on how you define "busy".
>
> busy = no commit is currently running from the client to server
I see.

>
> > What means "undesired"? Why don't you prevent undesired sessions from
> > the beginning? Or can they *become* undesired?
>
> undesired = session that is supposed to be closed immediately (session
> management)
I still don't really understand this explanation, but I think I doesn't
matter that much ;-)

>
> > I don't think it's possible to corrupt data on the server. Have you
> > tried it?
>
> Actually, I have few reports (I suppose it was working with derby DB),
> that after similar session closing, model cannot longer
> be used - it gives me reason to believe in data corruption. Why do you
> think that session closing somewhere in the middle of commit cannot
> break model?
The backend (your Derby DB) should be protected by backend transactions.
But I just learned that DDL (create table, etc...) is often not part of
normal transactions. Surprisingly Derby is the only known exception
(known to us). Maybe that's why Derby is so unbelievably slow. It would
be great if you can report in more detail what happens after such
session deactivation in the middle of a CDO transaction. Maybe we can do
better cleanup for the DDL parts of the commit...

Apart from the backend integrity we need to think about the integrity of
the CDO repository infra structure (caches, registries, etc...). These
*should* be protected against commit failure. But we're only human. So,
if you can report concrete problems, ideally with a test case, we would
like to address them.

Cheers
/Eike

----
http://thegordian.blogspot.com
http://twitter.com/eikestepper




>
>
> Eike Stepper wrote:
>> Egidijus,
>>
>> Comments below...
>>
>>
>> Egidijus Vaisnora schrieb:
>>> How could I find out that CDO session on *server* is busy?
>> Depends on how you define "busy".
>>
>> The Session class extends Lifecycle, so you can always ask
>> LifecycleUtil.isActive(session) or register an IListener with it. But:
>> The SessionManager automatically detects deactivated sessions and
>> removes them.
>>
>>> Idea is that I am closing sessions on server side (let say
>>> administrator can kill undesired sessions),
>> What means "undesired"? Why don't you prevent undesired sessions from
>> the beginning? Or can they *become* undesired?
>>
>>> however I don't want to kill a session which is reading something from
>>> the client side - just because to avoid possible data corruption on
>>> server.
>> I don't think it's possible to corrupt data on the server. Have you
>> tried it?
>>
>> Cheers
>> /Eike
>>
>> ----
>> http://thegordian.blogspot.com
>> http://twitter.com/eikestepper
>>
Re: [CDO] Session busy indicator [message #431527 is a reply to message #431520] Wed, 15 July 2009 08:02 Go to previous messageGo to next message
Eike Stepper is currently offline Eike Stepper
Messages: 5514
Registered: July 2009
Senior Member
Egidijus,

I think we can build a commit gauge into the session protocol.
If you want that, please file an enhancement request against HEAD.

Cheers
/Eike

----
http://thegordian.blogspot.com
http://twitter.com/eikestepper



Egidijus Vaisnora schrieb:
>
> How could I find out that CDO session on *server* is busy?
> Idea is that I am closing sessions on server side (let say
> administrator can kill undesired sessions), however I don't want to
> kill a session which is reading something from the client side - just
> because to avoid possible data corruption on server.
Re: [CDO] Session busy indicator [message #431528 is a reply to message #431527] Wed, 15 July 2009 08:10 Go to previous messageGo to next message
Stefan Winkler is currently offline Stefan Winkler
Messages: 277
Registered: July 2009
Location: Germany
Senior Member
Eike,

I think what he means is that he wants a way to determine if it is safe
to shut down the server (e.g., for maintenance).

A definition on store level of that would be that no writer is currently
checked out (don't care about readers as they do only reading).

So maybe the general request here is for a safe way to shut down the
server - e.g. put it into a mode where it does not accept any more
sessions and waits until all session which started writing have finished
doing so ...

Egidijus, is that what you mean?

Cheers,
Stefan


Eike Stepper schrieb:
> Egidijus,
>
> I think we can build a commit gauge into the session protocol.
> If you want that, please file an enhancement request against HEAD.
>
> Cheers
> /Eike
>
> ----
> http://thegordian.blogspot.com
> http://twitter.com/eikestepper
>
>
>
> Egidijus Vaisnora schrieb:
>
>> How could I find out that CDO session on *server* is busy?
>> Idea is that I am closing sessions on server side (let say
>> administrator can kill undesired sessions), however I don't want to
>> kill a session which is reading something from the client side - just
>> because to avoid possible data corruption on server.
>>
Re: [CDO] Session busy indicator [message #431530 is a reply to message #431528] Wed, 15 July 2009 08:21 Go to previous messageGo to next message
Eike Stepper is currently offline Eike Stepper
Messages: 5514
Registered: July 2009
Senior Member
Guys,

I thought about maintaining an RWLock in the server side session:

"R" refers to the execution of a CDO commit operation.
"W" refers to explicit maintenance of that session, i.e. protection
against multiple concurrent commits.

How about that?

Cheers
/Eike

----
http://thegordian.blogspot.com
http://twitter.com/eikestepper



Stefan Winkler schrieb:
> Eike,
>
> I think what he means is that he wants a way to determine if it is safe
> to shut down the server (e.g., for maintenance).
>
> A definition on store level of that would be that no writer is currently
> checked out (don't care about readers as they do only reading).
>
> So maybe the general request here is for a safe way to shut down the
> server - e.g. put it into a mode where it does not accept any more
> sessions and waits until all session which started writing have finished
> doing so ...
>
> Egidijus, is that what you mean?
>
> Cheers,
> Stefan
>
>
> Eike Stepper schrieb:
>
>> Egidijus,
>>
>> I think we can build a commit gauge into the session protocol.
>> If you want that, please file an enhancement request against HEAD.
>>
>> Cheers
>> /Eike
>>
>> ----
>> http://thegordian.blogspot.com
>> http://twitter.com/eikestepper
>>
>>
>>
>> Egidijus Vaisnora schrieb:
>>
>>
>>> How could I find out that CDO session on *server* is busy?
>>> Idea is that I am closing sessions on server side (let say
>>> administrator can kill undesired sessions), however I don't want to
>>> kill a session which is reading something from the client side - just
>>> because to avoid possible data corruption on server.
>>>
>>>
Re: [CDO] Session busy indicator [message #431531 is a reply to message #431528] Wed, 15 July 2009 08:38 Go to previous message
Egidijus Vaisnora is currently offline Egidijus Vaisnora
Messages: 47
Registered: July 2009
Member
Something close to this - just at current time I have addressed problem to the single session closing (it is not about whole
server shutdown).
In real, I need to answer question - "is it save (no commit is present) to close particular *server* session?". Or event it
cold be better in this case, that CDO server on session closing shall be responsible to wait while session writing ends and
only then terminate session.

Stefan Winkler wrote:
> Eike,
>
> I think what he means is that he wants a way to determine if it is safe
> to shut down the server (e.g., for maintenance).
>
> A definition on store level of that would be that no writer is currently
> checked out (don't care about readers as they do only reading).
>
> So maybe the general request here is for a safe way to shut down the
> server - e.g. put it into a mode where it does not accept any more
> sessions and waits until all session which started writing have finished
> doing so ...
>
> Egidijus, is that what you mean?
>
> Cheers,
> Stefan
>
>
> Eike Stepper schrieb:
>> Egidijus,
>>
>> I think we can build a commit gauge into the session protocol.
>> If you want that, please file an enhancement request against HEAD.
>>
>> Cheers
>> /Eike
>>
>> ----
>> http://thegordian.blogspot.com
>> http://twitter.com/eikestepper
>>
>>
>>
>> Egidijus Vaisnora schrieb:
>>
>>> How could I find out that CDO session on *server* is busy?
>>> Idea is that I am closing sessions on server side (let say
>>> administrator can kill undesired sessions), however I don't want to
>>> kill a session which is reading something from the client side - just
>>> because to avoid possible data corruption on server.
>>>
Previous Topic:isComposite and isId usage ?
Next Topic:Emf libraries to Central Maven Repository
Goto Forum:
  


Current Time: Tue Sep 02 12:52:10 EDT 2014

Powered by FUDForum. Page generated in 0.04859 seconds