-
Jun 16th, 2010, 01:28 PM
#1
Making ItemReader threadsafe
How do we make the StoredProcedureItemReader thread-safe?
-
Jun 18th, 2010, 04:09 AM
#2
You can synchronize the read() method (e.g. by wrapping it in a delegator that does the synchronization). Remember that you will lose restartability, so best practice is to mark the step as not restartable and to be safe (and efficient) you can also set saveState=false on the reader.
-
Jun 23rd, 2010, 10:20 AM
#3
Multi thread fails...
I am running the StoredProcedureItemReader in a multithreaded fasion. I get the below error
Encountered an error executing the step
org.springframework.dao.InvalidDataAccessResourceU sageException: Unexpected cursor position change.
when I run in single threaded mode I dont have this issue....
-
Jun 23rd, 2010, 12:58 PM
#4
I am using the spring class StoredprocedureItemReader....How do i synchronise the read method then?
-
Jun 25th, 2010, 04:17 AM
#5
Did you try my original suggestion: "wrapping it in a delegator that does the synchronization"?
-
Jun 25th, 2010, 12:34 PM
#6
Im not sure how to do that...is there an example you can point to? Thanks a lot...
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules