problem with locking

Questions, tips and tricks and techniques for scripting in Servoy

problem with locking

Postby Harjo » Mon Jun 02, 2003 1:28 pm

I have the following two methods on the same layout linked to: OnRecordEditStart
databaseManager.acquireLock(foundset, 0)

and OnRecordSave
databaseManager.releaseAllLocks()



This works well, between all clients, but it does'nt work well in combination with Servoy Developer. If I edit a record in Developer and I go thru a client to the same record, i'll get the message: Record is locked. So far so good! If I leave the record in the developer and go back to the client en try to have acces, it still give me the message: record is locked!
As I said: between all clients, it works good!
[/quote]
Harjo
 
Posts: 4321
Joined: Fri Apr 25, 2003 11:42 pm
Location: DEN HAM OV, The Netherlands

Postby Harjo » Tue Jun 03, 2003 12:40 am

Nobody has this problem?

Other question: Is it possible to make from these 2 methods --> global methods?
So I can use them on every layout??
Harjo
 
Posts: 4321
Joined: Fri Apr 25, 2003 11:42 pm
Location: DEN HAM OV, The Netherlands

Postby Jan Aleman » Tue Jun 03, 2003 12:50 am

It has been identified as an issue in Servoy Developer, the good news is that you only need locking in Servoy Client. The client functionality in developer is meant for quick access to your data only. We recommend doing lock testing in client only for the time being.

It is certainly possible to create this in a global method, in fact this kind of things is exactly where global methods were meant for.
Jan Aleman
Servoy
Jan Aleman
 
Posts: 2083
Joined: Wed Apr 23, 2003 9:49 pm
Location: Planet Earth

Postby Harjo » Tue Jun 03, 2003 1:04 am

How? I tried several things, but I can't get it work!
Harjo
 
Posts: 4321
Joined: Fri Apr 25, 2003 11:42 pm
Location: DEN HAM OV, The Netherlands

Postby Jan Aleman » Tue Jun 03, 2003 12:14 pm

Code: Select all
databaseManager.acquireLock(forms[currentcontroller.getName()].foundset,0)


Make sure you are careful when you drill down to a foundset inside a global method, it is quite easy to introduce memory leaks in your solution.
Jan Aleman
Servoy
Jan Aleman
 
Posts: 2083
Joined: Wed Apr 23, 2003 9:49 pm
Location: Planet Earth

Postby Harjo » Tue Jun 03, 2003 1:07 pm

I'm sorry, but it doesn't work in my solution.
The little blue-lock is'nt visible when i click into a field.
Harjo
 
Posts: 4321
Joined: Fri Apr 25, 2003 11:42 pm
Location: DEN HAM OV, The Netherlands

Postby Jan Aleman » Tue Jun 03, 2003 1:26 pm

That appears to be a 1.01 issue, I can't reproduce it on 1.1
Jan Aleman
Servoy
Jan Aleman
 
Posts: 2083
Joined: Wed Apr 23, 2003 9:49 pm
Location: Planet Earth

Postby maarten » Fri Jun 20, 2003 6:47 pm

This works well, between all clients, but it does'nt work well in combination with Servoy Developer. If I edit a record in Developer and I go thru a client to the same record, i'll get the message: Record is locked. So far so good! If I leave the record in the developer and go back to the client en try to have acces, it still give me the message: record is locked!
As I said: between all clients, it works good!


This is fixed in next release (after rc3)
Maarten Berkenbosch
User avatar
maarten
 
Posts: 797
Joined: Wed Apr 23, 2003 10:52 pm
Location: Amersfoort, Netherlands


Return to Methods

Who is online

Users browsing this forum: No registered users and 6 guests