Skip to Content
0
Former Member
Feb 16, 2011 at 05:07 PM

2 JDBC statements in one message - order of processing?

85 Views

Hello,

a table has to be deleted always before new data is inserted. I am considering two alternatives getting this done:

1. Two SQL statements (delete/truncate and insert) in one messages

2. Two service interfaces (each containing one SQL statement)

Alternative 1 is preferred of course as only 1 interface and 1 mapping is needed. However I do have some concerns if the order of SQL processing is definitely done in the order of the SQL statements defined in the XML. I wonder if there is a small risk that the second statement could be executed before the first one in some cases or that the second statement is even executed if the first one fails. Alternative 2 would offer the possibility to maintain the order in the interface determination.

What is your opinion on this?