james strachan commented on ZOOKEEPER-84:

I'm kinda confused by that :)

So what am I meant to do if I get a SessionExpiredException? I want to 
reconnect with a new session; as the current connection is totally useless and 

Right now the only option I can see is to recreate from scratch the entire 
ZooKeeper object?

If so that means we've gotta introduce a ZooKeeperProxy thingy which wraps the 
ZooKeeper object and just lets it be recreated if a SessionExpiredException 
occurs. Seems kinda unnecessary when really a ZooKeeper instance is capable of 
easily recreating the connection to the ZK server when the session is expired.

Maybe the issue is the phrase reconnect() - maybe a method called 
recreateNewSession() is better? We could also document it that this is only to 
be called if your client becomes invalid because the ZK server has expired the 

> provide a mechanism to reconnect a ZooKeeper if a client receives a 
> SessionExpiredException
> -------------------------------------------------------------------------------------------
>                 Key: ZOOKEEPER-84
>                 URL: https://issues.apache.org/jira/browse/ZOOKEEPER-84
>             Project: Zookeeper
>          Issue Type: Improvement
>          Components: java client
>            Reporter: james strachan
>            Assignee: james strachan
>         Attachments: reconnect_patch.patch
> am about to attach a patch which adds a reconnect() method to easily 
> re-establish a connection if a session expires - along with a toString() 
> implementation for easier debugging

This message is automatically generated by JIRA.
You can reply to this email to add a comment to the issue online.

Reply via email to