Eclipse Community Forums - RDF feed
https://www.eclipse.org/forums/
Eclipse Community Forums[CDO] Session busy indicator
https://www.eclipse.org/forums/index.php/mv/msg/136760/431520/#msg_431520
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.]]>Egidijus Vaisnora2009-07-15T09:21:53-00:00Re: [CDO] Session busy indicator
https://www.eclipse.org/forums/index.php/mv/msg/136760/431522/#msg_431522
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]]>Eike Stepper2009-07-15T09:51:49-00:00Re: [CDO] Session busy indicator
https://www.eclipse.org/forums/index.php/mv/msg/136760/431524/#msg_431524
> 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
>]]>Egidijus Vaisnora2009-07-15T11:39:10-00:00Re: [CDO] Session busy indicator
https://www.eclipse.org/forums/index.php/mv/msg/136760/431525/#msg_431525
> 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.
>
>
> 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
>>]]>Eike Stepper2009-07-15T11:50:22-00:00Re: [CDO] Session busy indicator
https://www.eclipse.org/forums/index.php/mv/msg/136760/431527/#msg_431527
I think we can build a commit gauge into the session protocol.
If you want that, please file an enhancement request against HEAD.
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.]]>Eike Stepper2009-07-15T12:02:17-00:00Re: [CDO] Session busy indicator
https://www.eclipse.org/forums/index.php/mv/msg/136760/431528/#msg_431528
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.
>>]]>Stefan Winkler2009-07-15T12:10:18-00:00Re: [CDO] Session busy indicator
https://www.eclipse.org/forums/index.php/mv/msg/136760/431530/#msg_431530
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.
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.
>>>
>>>]]>Eike Stepper2009-07-15T12:21:21-00:00Re: [CDO] Session busy indicator
https://www.eclipse.org/forums/index.php/mv/msg/136760/431531/#msg_431531
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.
>>>]]>Egidijus Vaisnora2009-07-15T12:38:04-00:00