Thread safe « Thread « Spring Q&A





1. Is the following utility class thread-safe?    stackoverflow.com

First let's look at the utility class (most javadoc has been removed to simply the example):

public class ApplicationContextUtils {

    /**
     * The application context; ...

2. Confusion about thread safety - SimpleDateFormat example    stackoverflow.com

I have a question about thread safety. From what I have been told, SimpleDateFormat is not thread safe. I was wondering what effects it would have if I use ...

3. NumberFormat thread safety with Spring    stackoverflow.com

NumberFormat JavaDoc says:

Number formats are generally not synchronized. It is recommended to create separate format instances for each thread.
I want to obtain an instance to ...

4. Is thread-safety a non-issue for Spring?    forum.springsource.org

Is thread-safety a non-issue for Spring? I'm used to working in environments where the container guarantees thread-safety, i.e. each instance of an application class is always run by at most one ...

5. Is a UriTemplate thread-safe?    forum.springsource.org

From the code, it's (almost) immutable and thread-safe, but there's nothing explicitly in the reference manual or the Javadoc suggesting it will remain that way. Thanks, Emerson PS. If it's meant ...

6. partitioning and thread safety    forum.springsource.org

I want to make sure I understand this. a partitioned step using partitioner and splitter are multi-threaded (as supposed to multi-processed), but each thread has its own instance of the step, ...

7. restart vs. thread safety    forum.springsource.org

restart vs. thread safety I am really confused why every time the documentation covers thread safety, is pulls in restart. How is restart related to statefulness of the reader and writers? ...

8. Is Spring singletn thread safe?    forum.springsource.org

I am using spring to create a singleton. The Spring config file looks as below Code: Is it thread safe or in other words multiple clients ...

9. MimeMessagePreparator thread safe issue    forum.springsource.org

Please correct me if I am wrong. It seems to me that it is not possible to implement a thread safe MimeMessagePreparator. Because MimeMessagePreparator only has one method: Code: public void ...





10. SimpleApplicationEventMulticaster is not thread safe!    forum.springsource.org

SimpleApplicationEventMulticaster is not thread safe! I want to register a new eventHandler in an event, I get a java.util.ConcurrentModificationException upon doing this. Is there a reason that this is implemented in ...

11. CustomDateEditor and thread-safety    forum.springsource.org

After learning that the parse() and format() methods of java.text.DateFormat and java.text.SimpleDateFormat are not thread-safe, I scanned my Spring-based web application for non-thread-safe uses, and found that CustomDateEditor accepts a DateFormat ...

12. DataBinder, PropertyEditor and thread-safety    forum.springsource.org

DataBinder, PropertyEditor and thread-safety Hi, I am using spring 2.0, hibernate 3.2 and Spring MVC. My question is: is it thread-safe to pass the same custom editor instance in SimpleFormController.initBinder() method? ...

13. Binding Thread-Safety with a PropertyEditorSupport class?    forum.springsource.org

Hello all, I'm not sure if the following code in my controller is thread-safe, could you please explain to me why, or why it isn't, thread-safe? Code: ... private EnvironmentManager envMgr; ...

14. Thread safety    forum.springsource.org

Hi, I have already checked the docs, nothing mentioned about thread safety for Mail and Ldap EntityManager: Normally it is not thread safe. But since I inject it via @PersitenceContext and ...

15. Is a intermediate layer object thread safe    forum.springsource.org

Hi, If there is a service object between a controller and a DAO,will it be thread safe... What should we do to make it thread safe in case....it isn't? Regards

16. Spring 2.5 Thread Safety    forum.springsource.org

I read an interesting article this morning: http://pitfalls.wordpress.com/2008/0...ngconcurrency/ I tried to be careful to understand the details. Given my limited understanding of threading, it seemed legit. Is SpringSource aware of the ...





17. Thread Safety    forum.springsource.org

Thread Safety Hi all, I've recently read http://www.javalobby.org/articles/thread-safe/index.jsp and http://static.springframework.org/sp...rence/orm.html whilst investigating thread safety issues to be expected in a Tomcat / Spring MVC / Hibernate application I am writing for ...

18. Tutorial sample - thread safety?    forum.springsource.org

I been playing around with the tutorial sample. Quick question re: the HolidayEndpoint class which is wired as a singleton in the application context. Am I correct that the XPath variables ...

19. Is SimpleJobRepository.createJobExecution thread safe?    forum.springsource.org

We have two machines trying to start the same Spring Batch, we want to have exactly one machine can successfully start a job and another one is throw JobExecutionAlreadyRunningException . Is ...

20. Question on thread safe item reader?    forum.springsource.org

Question on thread safe item reader? Hi, I have a job which reads account ids from the database and runs calculations and writes into the database. I am running this job ...

21. Item Reader Thread safe?    forum.springsource.org

Do you have a few more details you can share? What type of input do you plan on reading? Is it from a database, file, etc? The StagingItemReader in the samples ...

22. StepExecutionResourceProxy Not Thread Safe?    forum.springsource.org

Hello, I am trying to run multiples of the the same job in parallel (flat file read) using the StepExecutionResourceProxy to pass in filenames at runtime. However I notice that when ...

23. Thread safe    forum.springsource.org

24. thread-safe instantiation question    forum.springsource.org

thread-safe instantiation question three classes below are usually not thread-safe under java memory model (specifically, they are not published safely to other threads): if one thread constructs them via new A(), ...

25. MapFactoryBean and thread-safe maps    forum.springsource.org

We recently encountered the problem of get() in HashMap entering an infinite loop (mentioned http://lightbody.net/blog/2005/07/ha...an_infini.html here. This caused us to wonder about the maps generated through the MapFactoryBean, and if they ...

26. advice needed on DI and thread-safety    forum.springsource.org

advice needed on DI and thread-safety I'm developing two very similar web-apps. They both use much of the same code except the front-end is different and the backend SQL statements differ ...

27. java.lang.reflect.Constructor thread safe ?    forum.springsource.org

When you have a Constructor object in Java. Is calling the newInstance method on the same Constructor object from multiple threads safe. Or is this not thread safe leading to wrongly ...

28. Thread safety of ProceedingJoinPoint    forum.springsource.org

Thread safety of ProceedingJoinPoint I am using an @Around advice and pass the ProceedingJoinPoint to another thread where it is executed. While from my understanding there shouldn't be any problems since ...

29. Thread and load balance safe "create if not exists"    forum.springsource.org

Thread and load balance safe "create if not exists" Hello, We are using Spring and Hibernate and we are having problem with implementing a quite simple algorithm so that it is ...

30. MessageChannelTemplate thread-safe?    forum.springsource.org

Hello, is the MessageChannelTemplate implementation thread-safe? I am considering if I should create a new instance for each invocation of a service method or not. Thanks, Dimo

31. Spring and thread safety (visibility)    forum.springsource.org

Spring and thread safety (visibility) After reading "Java Concurrency In Practice" I am verifying thread safety of my own classes which use Spring and I may be mistaken, but it seems ...

32. Is JpaDaoSupport thread safe?    forum.springsource.org

Hi I'm planning to use Spring's Jpa persistence mechanism in my web app. Most of the mechanism is clear to me, maybe except for one thing. My service class is app-scoped, ...

33. Thread-Safe Reader/Writer    forum.springsource.org

Thread-Safe Reader/Writer I'm creating a simple job. The first step is to read a record from the db(id sent via a param). The writer then puts the record in the step/job ...

34. is Jaxb2Marshaller thread safe?    forum.springsource.org

The javadoc makes no mention if Jaxb2Marshaller is thread safe. In particular are marshall() / unmarshall() thread safe? While objects returned from createMarshaller() / createUnmarshaller() are clearly said not to be ...

35. Thread Safety in EndpointInterceptor    forum.springsource.org

Thread Safety in EndpointInterceptor Hi, I have a requirement to extract some portion of SOAP Header from the request, and send it back in the response as it is. I am ...

36. Thread Safe    forum.springsource.org

thanks For the reply, and i have one more question,if the bean of a controller is singleton then it can be said as thread safe.If not so how can i make ...

37. LazyConnectionDataSourceProxy.getTargetConnection is not thread safe    forum.springsource.org

LazyConnectionDataSourceProxy.getTargetConnection is not thread safe LazyConnectionDataSourceProxy.getTargetConnection is not thread safe. If two threads both try to invoke a method on the connection that would result in a connection being initiated from ...

38. Sample code is multi-thread safe?    forum.springsource.org

Hi, Taking a look to the sample code of section 10.2.5 of the reference documentation (Data Access using JDBC) I am left wondering whether it is multi-thread safe, since several methods ...