Skip to Content
avatar image
Former Member

JDBC : Rollback

HI

I am using JDBC as Receiver and my req is getting file(FTP) and (delete * from tables ) then (insert * into tables) using JDBC) /multiple tables.

Its like this.Part of data from file into one table and 2nd part into other table,but remember before inserting data from file to DB i have to delete all from DB.

My question is ...In this process,after deletion and before inserting if some thing happens do we have an option to rollback everything in DB.

Please let me know

Thanks

Prabhakar

Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

7 Answers

  • avatar image
    Former Member
    Oct 17, 2008 at 07:15 AM

    Hi,

    I think there is nothing specific for rollback, but i think using BPM you can use Exceptions to avoid a mistake.

    Add comment
    10|10000 characters needed characters exceeded

  • avatar image
    Former Member
    Oct 17, 2008 at 07:24 AM
    Add comment
    10|10000 characters needed characters exceeded

  • avatar image
    Former Member
    Oct 17, 2008 at 09:39 AM

    you can achieve it by using database stored procedure.

    you just write stored procedure and write delete and insert statement in that , there you can also handle the rollback .

    Add comment
    10|10000 characters needed characters exceeded

  • avatar image
    Former Member
    Oct 17, 2008 at 09:56 AM

    Hey just to give you some confirmation on the above proposal of using a stored procedure.

    I have worked with a similar requirement in the past and after looking at a few options, I ended up going for the stored procedure.

    It was better as the logic is encapsulated on the DB side, this way it guarentees the data is treated correctly.

    Add comment
    10|10000 characters needed characters exceeded

  • avatar image
    Former Member
    Oct 20, 2008 at 04:21 AM

    Any more Ideas?

    Add comment
    10|10000 characters needed characters exceeded

  • avatar image
    Former Member
    Oct 20, 2008 at 04:29 AM

    HI Prabhakar

    Using BPM you can hold back data if any error happend, you can raise the alert as well.

    Another thing that you can do is Make the scenario File - Java proxy and from proxy you insert the data. There you can use Heirarcial SQL statement and even check at every state if the data is inserted/updated/deleted or not and can rollback

    Thanks

    Gaurav

    Add comment
    10|10000 characters needed characters exceeded

  • avatar image
    Former Member
    Oct 29, 2008 at 02:32 PM

    Thanks Alex.

    Add comment
    10|10000 characters needed characters exceeded