Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    text
    copied!<p>Your <code>PobaseServiceImpl</code> class is not thread-safe. In Java any remote called service(and of course the same goes the singletons in the container too)should be prepared that its methods will be called from the different threads and the same method can be executed simultaneously in the different threads.</p> <p>The entire class needs a detailed check.</p> <p>First of all, you should use <code>ConcurrentHashMap</code> instead of <code>HashMap</code>. And all methods need to be carefully rewritten - for example the method that return ArrayList ( <code>public ArrayList&lt;PobaseData&gt; resyncExternPobase()</code>) should make a defensive copy of the data.</p> <p>As an alternative you should consider making the public methods your service methods <strong>synchronized</strong>, however, that will force the methods to be executed sequentially and that will undermine performance if the service is expected to be actively used from the different threads.</p> <p>For the reference, consider reading Brian Goetz <a href="http://rads.stackoverflow.com/amzn/click/0321349601" rel="nofollow">Java Concurrency In Practice</a>, chapter 5. <em>Building Blocks</em> and especially <em>5.1 Synchronized collections</em> and <em>5.2. Concurrent collections</em></p> <p><strong>update</strong>: Your <em>PobaseServiceImpl</em> seems to be a servlet that is instantiated by the servlet container - to populate its fields with Spring beans you're you should use Spring utility methods - for example <code>WebApplicationContextUtils</code> - there are many examples in the internet, like <a href="http://pgt.de/2009/07/17/non-invasive-gwt-and-spring-integration-reloaded/" rel="nofollow">http://pgt.de/2009/07/17/non-invasive-gwt-and-spring-integration-reloaded/</a></p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload