Confused about transaction and locks

I am kinda new to the whole transaction model, and during a test wit multiple I have encountered some problems.
ServoyClients where hanging up everytime someone had a transaction.

At first we only used for editing a dossier:

goto editscreen
start transaction
do your changes
commit or rollback

That didn’t work. Servoy clients where on hold repeatly waiting for someone to end his transaction.

Then I used

goto editscreen 
acquireLock(foundset,0)
if (!succes) => 
     Message record is locked blah blah, 
     return;

start transaction
do your changes
commit or rollback
releasealllocks

The last one worked a bit better, becoz the second client could not edit the same dossier when the first client was editing. But the strange thing is…that the second client cannot edit any other dossier without having to wait for the first client releasing the first dossier.

SO am I using this acquirelock and transaction all wrong then?

The transaction handling is done by the database. Some databases use pessimistic locking when using transactions. To ensure data consistency records in a transaction are simply locked. Depending on where you start your transaction, even more than the one record you are editing could be locked (maybe a complete foundset).

So to answer your question better, please let us know which database you are using. From what you describe it sounds a bit like MS SQL Server 2000…

if (!succes) =>
Message record is locked blah blah,
return;

Did you accidentally create an indefinitive loop here?

What is the exact code you use for this?

IT2Be:

if (!succes) =>
Message record is locked blah blah,
return;

Did you accidentally create an indefinitive loop here?

What is the exact code you use for this?

No there is no infinite loop…but after some discussing with folks…it seems that Sybase does something like page-locking when in transaction which locks several rows and prevents them from showing up on other clients…so I removed all the transactions in all of my methods…and when we move to Servoy 3 we will autosave-option.
Thankx for the input thusfar guys