June 20, 2006

Singleton in Spring

Today I found an error in my project related to the singleton in Spring.

A class Pager is a Spring bean injected to a controller by IoC container.
In one method of the controller, it use Pager.data variable to store submissions from a form.

If two threads send the request at the same time, then Pager.data was written twice. So potentially the controller will return wrong result for one form.


- No comments Not publicly viewable


Add a comment

You are not allowed to comment on this entry as it has restricted commenting permissions.

Trackbacks

  1. Singleton in Spring

    A spring bean default to be singleton. The following class is a Spring beanClass Transform{ private Map errors = new HashMap(); public void setErrors(final Map errors) { this.errors = errors; } public void transform(){ ...

    Oracle/Java/Others - 07 Nov 2006, 14:57

Search this blog

Search Warwick Blogs

 

Tags

Most recent comments

  • Oracle 11g is the clear leader in this area. Oracle has invested he… by shaane on this entry
  • All the features are very nice.I like Repair Advisors the most.Orac… by lucy on this entry
  • “logical standby failed to re–start, I am also getting … by anemia on this entry
  • thanks for give nice information for health.. by Appointment Setting on this entry
  • Thanks for the nice information because from last three days i am s… by robot vacuum on this entry
Not signed in
Sign in

Powered by BlogBuilder
© MMXII