Win a copy of Java EE 8 High Performance this week in the Java/Jakarta EE forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

Question on Session Event Listeners  RSS feed

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
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!