This week's book giveaway is in the JavaScript forum.
We're giving away four copies of Cross-Platform Desktop Applications: Using Node, Electron, and NW.js and have Paul Jensen on-line!
See this thread for details.
Win a copy of Cross-Platform Desktop Applications: Using Node, Electron, and NW.js this week in the JavaScript forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

Question on Session Event Listeners  RSS feed

 
chandru ram
Greenhorn
Posts: 18
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi All,
Are the Session listener events synchronous or asynchronous??.

Can the Listener event class be used to interact with the database.

For example, when i set an attribute to a session, the container will invoke the attributeAdded method of the listener class. Now i want to store the session data in a database.
can this process of saving to the DB be done inside the attributeAdded method of the listener. is this a proper design.
Also do the container call the listener's method from the same thread of execution of the client. (i.e) a request will have a thread to access the servlet. If we set a value in session, the container has to invoke the listener. So does the container do this within the same thread or it uses different threads to invoke the listeners asynchronously??
Thanks in advance,
Chandru ram
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!