aspose file tools*
The moose likes JSP and the fly likes Is a session ID from 2 separate JVMs unique? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » JSP
Bookmark "Is a session ID from 2 separate JVMs unique? " Watch "Is a session ID from 2 separate JVMs unique? " New topic
Author

Is a session ID from 2 separate JVMs unique?

Carmi Gazit
Greenhorn

Joined: Aug 27, 2003
Posts: 10
I'm trying to record some session based data into a database. I want to use the sessionID , but am not sure how unique it is. The data being recorded belongs to 2 application, each executes in its own JVM, possibly a different physical server .
So, is the HTTPSession ID universally unique?

Thanks!
Anupam Sinha
Ranch Hand

Joined: Apr 13, 2003
Posts: 1088
Different JVMs may have generate different Session IDs.
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 61652
    
  67

But I would not bet the farm on it. Rather than relying on the ession ID, you'd be better off assigning a known unique value to each session to use as a database key, perhaps generated from a DB seuqence.


[Asking smart questions] [Bear's FrontMan] [About Bear] [Books by Bear]
Carmi Gazit
Greenhorn

Joined: Aug 27, 2003
Posts: 10
yes, I was going in that direction (using a DB generated key), and wanted to make sure it was the right approach.

Thanks for the replies!
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Is a session ID from 2 separate JVMs unique?