Page 1 of 1

dbManager automatically handle disconnections?

Posted: 23 Jan 2024, 04:03
by heroumi
Hi,
1.
Does dbManager connections automatically handle disconnections?
Is it any problem if I run multiple functions in a row with dbManager like this?
Thank you.

Code: Select all

var dbManager = getParentExtension().getParentZone().getDBManager();

FriendUpdate(dbManager, source_id, destination_id);
FriendAdd(dbManager, source_id, destination_id, position);
EdgeUpdate(dbManager, source_id, destination_id, position);


2.
Is it possible to get the key returned by executeUpdate? executeInsert can get it.
Executes a SQL INSERT command returning the key of the inserted row

Re: dbManager automatically handle disconnections?

Posted: 23 Jan 2024, 08:10
by Lapo
Hi,
connections to the database are normally run in a local network so disconnections are highly unlikely. If you get disconnected in the middle of a DB transaction you will get a SQLException.

Is it any problem if I run multiple functions in a row with dbManager like this?

No it's not a problem.

Is it possible to get the key returned by executeUpdate? executeInsert can get it.

No that's not possible.

Cheers

Re: dbManager automatically handle disconnections?

Posted: 23 Jan 2024, 08:35
by heroumi
thank for info :D