Subject Re: [ib-support] Serialization?
Author Raul Chirea
Matteo,

From: "Matteo Giacomazzi" <matteo.giacomazzi@...>

> But I wonder if it isn't a "bad thing" to build up a "procedure" on
> ROLLBACKs...

I hope you meant a client procedure not a server one ! A server procedure
can't handle transactions. A server procedure is alwais runned inside a
transaction.

> Maybe, instead of ROLLBACK i could DELETE the row just inserted?

No, there's no problem using rollback.

> SET TRANSACTION NAME TRANS_1 [...]

/* This will be fine. */
SET TRANSACTION NAME TRANS_1 WAIT;

/* This will eventualy wait untill other thread is done */
> INSERT INTO ACTIVE_HOST (HOST_ID) [...]

> SET TRANSACTION NAME TRANS_2 [...]
> [...download the document...]
> COMMIT TRANS_2;

/* no need to delete + commit, rollback would do same thing */
ROLLBACK TRANS_1;

> But, really, I don't like too much to keep a transaction opened for a
> so long time...

I don't see this as a problem. The server can easily take it !
IB/FB is not a toy and handling transactions is it's one of the best parts !

Raul.