Zeos multiuser and transaction support code

In this forum we will discuss things relating the ZEOSLib 6.6.x stable versions

Moderators: gto, EgonHugeist

Post Reply
JD
Senior Boarder
Senior Boarder
Posts: 53
Joined: 06.09.2009, 18:27

Zeos multiuser and transaction support code

Post by JD »

Can anyone give me details on how Zeos handles multiuser and transaction support in a network environment?

If it is possible to have some working code samples, I'd really appreciate it. I've been Googling for a while now but I'm not really satisfied with the little information that I found. Thanks a million.
User avatar
mdaems
Zeos Project Manager
Zeos Project Manager
Posts: 2766
Joined: 20.09.2005, 15:28
Location: Brussels, Belgium
Contact:

Post by mdaems »

JD,

What kind of info are you looking for?
Every connection is using a different transaction. So when each user uses it's own connection there should be no multiuser issues. Each connection behaves like it's the only one using the database.

Mark
Image
Wild_Pointer
Expert Boarder
Expert Boarder
Posts: 164
Joined: 18.03.2008, 13:03
Contact:

Post by Wild_Pointer »

JD,

from my experience with Zeos + Postgres I'll advice you not to use single connection object in several threads. I don't know what database management system are you working on, but libpq does not support this (I found that out the hard way). So check your DB provider :)

Good luck.
JD
Senior Boarder
Senior Boarder
Posts: 53
Joined: 06.09.2009, 18:27

Post by JD »

Sorry for the late, late response. In essence, I want to better understand how Zeos handles database transactions and how to write failsafe code for users attempting to modify the same item of data.

If I understand what Wild Pointer & mdaems have said above, it would be better for me to create a new data module (with data connection, queries, stored procedures etc) running in its own isolated thread for every user attempting to connect to the database. That sounds logical.

However, I still need some examples of Zeos code to handle stuff like transaction rollback if an error occurred.

By the way, I'm using Firebird 2.1.3 & PostgreSQL 9.

Thank you for your kind assistance.
Wild_Pointer
Expert Boarder
Expert Boarder
Posts: 164
Joined: 18.03.2008, 13:03
Contact:

Post by Wild_Pointer »

JD,

I'll sugest you read http://zeos.firmos.at/kb.php?mode=article&k=9 That will give you several thoughts to start with when using Postgresql.

Good luck!
JD
Senior Boarder
Senior Boarder
Posts: 53
Joined: 06.09.2009, 18:27

Post by JD »

Thanks for the link, Wild_Pointer
Post Reply