Subject Re: AW: AW: [Firebird-Java] Do I need to commit every transaction if I'm using jaybird?
Author Jim Starkey
Steffen Heil wrote:

> Hi
>
> > As I wrote, I have no example for now.
>
> Oh, you have, see below... :D
>
> > > They work or they are rolled back by some exception.
> >
> > True. But work of a single statement. Procedure is also
> > considered a single statement. All this is controlled by
> > internal savepoints.
>
> Okay, hence this is down to the definition of "single statement".
>
> > > So, can you explain what you ment and give any example?
> >
> > Sure, theoretical example would be:
> >
> > Statement stmt = con.createStatement();
> > stmt.execute("INSERT INTO bla VALUES(1); INSERT INTO bla
> > VALUES(2); UPDATE bla SET id = 2");
>
> This in my POV are three statements. Not one.
> This may be one JDBC statement, but these ARE three SQL statements.
>

If you anyone is depending on a multi-layer interface stack to makes a
series SQL statements atomic, they are asking for trouble, and should
complain when trouble arrives.

Database semantics provide explicit transaction control. Use it.

--

Jim Starkey
Netfrastructure, Inc.
978 526-1376