> Hi guys,
> i've a question for you.
[quoted text clipped - 7 lines]
> Can you help me with idea or examples?
> Thanks very much
I assume you know how to upload a file by now. First, make sure the
mysql database supports transactions (the default doesn't, I always use
InnoDB). To perform a transaction, you must do something like below. I
didn't copy/paste, so I might have forgotten some things.
conn.setAutoCommit(false);
try {
conn.execute(query1);
conn.execute(query2);
conn.commit();
} catch( (SQL)Exception e) { conn.rollback(); }
The only problem I have (maybe you or someone else knows a solution), is
that I have I database with an auto_increment field. I need to insert
some data in one table, fetch the id from the increment field and use
this id for some other inserts (all within the same transaction). It
causes a deadlock.