Problem with TransactIsolationLevel tiSerializable

Forum related to PostgreSQL

Moderators: gto, cipto_kh, EgonHugeist, olehs

Post Reply
jascha
Fresh Boarder
Fresh Boarder
Posts: 9
Joined: 14.10.2005, 14:31
Location: Füssen
Contact:

Problem with TransactIsolationLevel tiSerializable

Post by jascha »

I have written a multiuser adressbook, with todo list. I use TransactIsolationLevel tiSerializable so that one user can not overwrite changed someone made on the same Record while he was editing it. This works all fine.
Now I want, that each user gets a notification, when he gets a new todo. For this I poll the Table every 10 seconds. Now the problem is, that I don't get changed someone else made to that table. At least not until I do insert something to it.
I use a seperate ZQuery for it.

If I use TransactIsolationLevel tiNone everything works.
zippo
Silver Boarder
Silver Boarder
Posts: 322
Joined: 12.10.2005, 18:01
Location: Slovenia

Post by zippo »

Hmmmm....

You're saying that even if another user actually made a change, there'e no difference until you post something in the same table? I don't know much about TrasnsactIsolationLevel, so I'll try to show you other ways to do the same job done.

As first, try to reconsider the usage of TrasnsactIsolationLevel. If everything is done by one Query.Post, then there's no need for TrasnsactIsolationLevel, because all the changes are committed in the POST procedure.

You coulds also try to use CachedUpdates on the client-side.

Do your users really touch other's TO-DO's? Ask yourself if the complex mechanism for licking is really needed, because how many chances are that two users edit the same record on the same time. If there's quite some chance, then go on, otherwise keep it simple and just use POST. But this is just a suggestion, so don't get angry :)
ssamayoa
Junior Boarder
Junior Boarder
Posts: 29
Joined: 14.01.2006, 19:06

Post by ssamayoa »

Before open polling table, commit and start a new transaction.

Regards.
jascha
Fresh Boarder
Fresh Boarder
Posts: 9
Joined: 14.10.2005, 14:31
Location: Füssen
Contact:

Post by jascha »

zippo wrote:Do your users really touch other's TO-DO's? Ask yourself if the complex mechanism for licking is really needed, because how many chances are that two users edit the same record on the same time. If there's quite some chance, then go on, otherwise keep it simple and just use POST. But this is just a suggestion, so don't get angry :)
Its not because of the Todos, its because of the Adressdata where it has already happened that 2 Persons edit the same Adress during the same time
jascha
Fresh Boarder
Fresh Boarder
Posts: 9
Joined: 14.10.2005, 14:31
Location: Füssen
Contact:

Post by jascha »

ssamayoa wrote:Before open polling table, commit and start a new transaction.

Regards.
This worked! Thank You!
It is a bit a hack, because i use AutoCommit:=true
I now do the following

ZConnection.AutoCommit:=false;
ZConnection.Commit;
ZConnection.StartTransaction;

do my query

ZConnection.Commit;
ZConnection.AutoCommit:=true;
Post Reply