Win a copy of Murach's Python Programming this week in the Jython/Python forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

Is a session ID from 2 separate JVMs unique?  RSS feed

 
Carmi Gazit
Greenhorn
Posts: 10
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 1090
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Different JVMs may have generate different Session IDs.
 
Bear Bibeault
Author and ninkuma
Marshal
Posts: 65830
134
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
Carmi Gazit
Greenhorn
Posts: 10
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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!
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!