Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>As far as I can see, they are executed in a transaction but the transaction isn't what you expect. When <code>autoCommit</code> is <code>true</code>, each query becomes a transaction. You have to configure the connection properly to avoid that.</p> <p>That said, a comment about XA: XA doesn't work in corner cases like network problems and timeouts. That is, it will work 99.9995% times but in a few critical cases, it won't and those are the cases which you care for.</p> <p>Make sure that your data structures don't get corrupted when XA eventually fails you.</p> <p>Instead of XA, I suggest to evaluate methods that allow to run transactions again. Example: You want to transfer some records from database A to B. So you read the rows with <code>FOR UPDATE</code> and for each transmitted row, you set the <code>processed</code> column to true.</p> <p>On the other side, you only add rows which aren't already present.</p> <p>After the tx in B has been committed, delete the rows in A <code>where processed = 'true'</code> or mark them in another way.</p> <p>That means you can run this as often as you need.</p> <p><strong>[EDIT]</strong></p> <p>To disable auto commit, you must call <code>con.setAutoCommit(false);</code> The problem is, of course, that you're using Spring, so you never explicitly ask for a connection anywhere.</p> <p>My suggestion: Extend <code>PoolDataSourceImpl</code> and override the various <code>get*Connection()</code> methods. Before you return them, set auto commit to false. You could also decompile the JDBC driver code to see whether <code>PoolDataSourceImpl</code> already contains something like that but apparently it doesn't.</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload