Announcement Announcement Module
Collapse
No announcement yet.
Stored procedure like ItemWriter Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • Stored procedure like ItemWriter

    Hi!

    I'm newbie in springbatch, so I have some questions...

    Is there any springbatch-defined ItemWriter (or ItemReader) to execute a stored procedure??

    Would it be difficult to implement? How could I do it?

    Thanks in advance!!

  • #2
    We don't currently have this functionality built in. However, it should be easy to write using a TaskletStep. See the "Example Tasklet implementation" section in the docs:
    http://static.springsource.org/sprin...p.html#d0e3104

    Comment


    • #3
      OK, thanks!

      Comment


      • #4
        What about the transaction when calling a Stored Procedure?

        What about the transaction management? For example if we want to write the item using a stored procedure for example inside a processor, should the stored procedure manage the rollback of its own transaction, as shown below? or can the stored-procedure's transaction being propagated so Spring Batch and Spring rollback if an exception occurs?

        Example (an Oracle SP):

        Code:
        PROCEDURE my_proc (...<PARAMS>...) IS
           BEGIN
              ...
              <INSERT logic>
              ...
        
              COMMIT;
           EXCEPTION
              WHEN OTHERS
              THEN
                 ROLLBACK;
           END my_proc;
        Originally posted by DHGarrette View Post
        We don't currently have this functionality built in. However, it should be easy to write using a TaskletStep. See the "Example Tasklet implementation" section in the docs:
        http://static.springsource.org/sprin...p.html#d0e3104

        Comment

        Working...
        X