• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Can we implement our own session object for Session tracking?

 
Greenhorn
Posts: 18
Netbeans IDE Tomcat Server Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi, Can we implement use defind session management. If we can, What will be the performance of the application.

Thanks.
 
Ranch Hand
Posts: 48
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Its not possible to Implement your own session object. Its maintained and created by the container which hosts the application.
 
clojure forum advocate
Posts: 3479
Mac Objective C Clojure
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I'm not sure what you mean exactly but definitely you can employ other techniques for session management.
For example you can store your session data in RDBMS or even in NoSQL solution like Redis or Riak (both are really convenient for this scenario).
 
Rancher
Posts: 1044
6
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
If you are not happy with the session management provided by the servlet container for some reason, you can try to roll out your own one. This might prove to be a tedious business though.

Why do you think you need this? Is there some special consideration/requirement?
 
Author and all-around good cowpoke
Posts: 13078
6
  • Likes 1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Sure. But as has been pointed out you will not be using any of the built in session capabilities.

Advantages - you control everything, you don't have to be dependent on cookies or url rewrite

Disadvantages - you have to write everthing, including some way to create a unique id and associate it with a particular user

Precautions: for any substantial load of users / size of objects stored, you will need a serialization mechanims - keep those objects Serializable.

Performance advantage: Probably not measurable or slower.

Bill
 
Sheriff
Posts: 67746
173
Mac Mac OS X IntelliJ IDE jQuery TypeScript Java iOS
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Why?
 
lakshmana dhanimireddi
Greenhorn
Posts: 18
Netbeans IDE Tomcat Server Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thank you to all

Actually I have requirement to replace the default session management to user defined session management.
 
Bear Bibeault
Sheriff
Posts: 67746
173
Mac Mac OS X IntelliJ IDE jQuery TypeScript Java iOS
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Bear Bibeault wrote:Why?

 
William Brogden
Author and all-around good cowpoke
Posts: 13078
6
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

lakshmana dhanimireddi wrote:Thank you to all

Actually I have requirement to replace the default session management to user defined session management.



Exactly what will your users want to define?

For session lifetime the built in HttpSession setMaxInactiveInterval gives you some control.

For persisting data over periods longer than a single web browser session, the usual approach is some sort of database, not extremely long session lifetimes.

Bill
 
reply
    Bookmark Topic Watch Topic
  • New Topic