You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomcat.apache.org by Roman Makurin <dr...@gmail.com> on 2010/10/15 10:02:12 UTC

lock session in distributed environment

Hi All!

I have an app which rely on session locking and its key
point here. Everything work on single tomcat instance,
but its completly broken in distributed env. So i want to
know is there any way to get my app working without
complete redesing? I need lock all incoming requests 
untill business logic will be done, this lock must be
available on all nodes in cluster.

any advise?

Thanks

-- 
If you think of MS-DOS as mono, and Windows as stereo,
 then Linux is Dolby Digital and all the music is free...

Re: What is the lifecycle of the apache tribes channel?

Posted by Pid <pi...@pidster.com>.
On 15/10/2010 16:45, Michael Knümann wrote:
>  Hi,
> 
> I'm using apache tribes for messaging between nodes within a cluster. My
> implementation bases on the quickstart example that is part of the
> related documentation.
> At the moment there is Context Listener that starts the communication
> like this:

Please start an entirely new message, rather than editing a reply to an
existing email - which leaves the thread mail headers intact & is
referred to as 'thread hijacking'.


p

What is the lifecycle of the apache tribes channel?

Posted by Michael Knümann <mk...@business-code.de>.
  Hi,

I'm using apache tribes for messaging between nodes within a cluster. My 
implementation bases on the quickstart example that is part of the 
related documentation.
At the moment there is Context Listener that starts the communication 
like this:

   myChannel = new GroupChannel();

     this.msgListener = msgListener;
     this.mbrListener = mbrListener;

     //attach the listeners to the channel
     myChannel.addMembershipListener(mbrListener);
     myChannel.addChannelListener(msgListener);

     //start the channel
     myChannel.start(Channel.DEFAULT);

This is a singleton instance and is used for sending messages the whole 
lifecycle of my webapplication.
I don't like this singleton and I'm wondering if it is possible to start 
the channel everytime I need to send a message?

with kind regards
     Michael




---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org


Re: lock session in distributed environment

Posted by Ronald Klop <ro...@base.nl>.
Op vrijdag, 15 oktober 2010 13:00 schreef Roman Makurin <dr...@gmail.com>:
> 
>  
> 
> On Fri, Oct 15, 2010 at 12:34:10PM +0200, Ronald Klop wrote:
> > Op vrijdag, 15 oktober 2010 10:02 schreef Roman Makurin <dr...@gmail.com>:
> > >
> > >
> > >Hi All!
> > >
> > >I have an app which rely on session locking and its key
> > >point here. Everything work on single tomcat instance,
> > >but its completly broken in distributed env. So i want to
> > >know is there any way to get my app working without
> > >complete redesing? I need lock all incoming requests untill
> > >business logic will be done, this lock must be
> > >available on all nodes in cluster.
> > >
> > >any advise?
> > >
> > >Thanks
> > >
> > >-- 
> > >If you think of MS-DOS as mono, and Windows as stereo,
> > > then Linux is Dolby Digital and all the music is free...
> > >
> > >
> > >
> > >
> > >
> > >
> > 
> > 
> > This is something a database can do very well. There are also things like a distributed HashMap which you might use to do locking in your setup.  But that probably is what you see as complete redesign (and it is :-) ).
> > 
> > Ronald.
> 
> Looks like HashMap is like distributed HttpSession object,
> but does it support locking? Eg. I lock session at first
> node and all other nodes r aware of this lock. 
>  
> 
> 
> 
> 
> 
> 

If you are locking with synchronized or something like that than it doesn't work between different JVM's.

Ronald.

Re: lock session in distributed environment

Posted by Roman Makurin <dr...@gmail.com>.
On Fri, Oct 15, 2010 at 12:34:10PM +0200, Ronald Klop wrote:
> Op vrijdag, 15 oktober 2010 10:02 schreef Roman Makurin <dr...@gmail.com>:
> >
> >
> >Hi All!
> >
> >I have an app which rely on session locking and its key
> >point here. Everything work on single tomcat instance,
> >but its completly broken in distributed env. So i want to
> >know is there any way to get my app working without
> >complete redesing? I need lock all incoming requests untill
> >business logic will be done, this lock must be
> >available on all nodes in cluster.
> >
> >any advise?
> >
> >Thanks
> >
> >-- 
> >If you think of MS-DOS as mono, and Windows as stereo,
> > then Linux is Dolby Digital and all the music is free...
> >
> >
> >
> >
> >
> >
> 
> 
> This is something a database can do very well. There are also things like a distributed HashMap which you might use to do locking in your setup.  But that probably is what you see as complete redesign (and it is :-) ).
> 
> Ronald.

Looks like HashMap is like distributed HttpSession object,
but does it support locking? Eg. I lock session at first
node and all other nodes r aware of this lock. 

-- 
If you think of MS-DOS as mono, and Windows as stereo,
 then Linux is Dolby Digital and all the music is free...

Re: lock session in distributed environment

Posted by Ronald Klop <ro...@base.nl>.
Op vrijdag, 15 oktober 2010 10:02 schreef Roman Makurin <dr...@gmail.com>:
> 
>  
> 
> Hi All!
> 
> I have an app which rely on session locking and its key
> point here. Everything work on single tomcat instance,
> but its completly broken in distributed env. So i want to
> know is there any way to get my app working without
> complete redesing? I need lock all incoming requests 
> untill business logic will be done, this lock must be
> available on all nodes in cluster.
> 
> any advise?
> 
> Thanks
> 
> -- 
> If you think of MS-DOS as mono, and Windows as stereo,
>  then Linux is Dolby Digital and all the music is free...
> 
> 
> 
> 
> 
> 


This is something a database can do very well. There are also things like a distributed HashMap which you might use to do locking in your setup.  But that probably is what you see as complete redesign (and it is :-) ).

Ronald.

Re: lock session in distributed environment

Posted by André Warnier <aw...@ice-sa.com>.
Roman Makurin wrote:
> Hi All!
> 
> I have an app which rely on session locking and its key
> point here. Everything work on single tomcat instance,
> but its completly broken in distributed env. So i want to
> know is there any way to get my app working without
> complete redesing? I need lock all incoming requests 
> untill business logic will be done, this lock must be
> available on all nodes in cluster.
> 
> any advise?
> 
Yes.  Since about 100 years, it is know that the speed of light is the absolute speed 
limit in the Universe, and that consequently the concept of "simultaneity" is a fallacy.
Thus if your application is such that it would rely on something being "simultaneously" 
available on different servers to stop something from happening, then your application is 
badly designed, and no external mechanism is going to be able to fix that.


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org