cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
JMP is taking Discovery online, April 16 and 18. Register today and join us for interactive sessions featuring popular presentation topics, networking, and discussions with the experts.
Choose Language Hide Translation Bar
DavidLeber
Level III

Multi-User Access

I'm working on a solution which will live on a network drive, to be accessed by multiple users asynchronously. Specifically, I have several "database" tables that users will add rows to, where the rows then contain links to their full submitted datatable. 

 

Is there any built-in way to manage file access permissions in a situation like this? I want to avoid a situation where a user opens the "database" table and forgets to close it, locking everyone else out of the tool. I could code in my own variation on a mutex, but I don't want to reinvent the wheel if there is a built-in, easy solution. The ideal solution would be some sort of JSL script that sends a row of data to a data table without taking the lock on the data table.

1 ACCEPTED SOLUTION

Accepted Solutions
David_Burnham
Super User (Alumni)

Re: Multi-User Access

Just to be clear, when you say "database" tables, you mean JMP tables?

 

I'm not aware of any ability to perform row locking - JMP is inherently single-user so I assume it doesn't have that ability.  This is what I do:

openSharedTable= Function({filePath},{default local},
	
	isLocked = 1;
	nAttempts = 200;
	delay = 0.1;
	attempts = 0;
	While(isLocked & attempts < nAttempts,
		attempts++;
		dt = open(filePath,Invisible);
		value = dt << Get Table Variable("Locked File");
		If (value=="",
			isLocked = 0
		,
			Close(dt,NoSave);
			Wait(delay);
		);
	);
	return(dt);
	
);
-Dave

View solution in original post

1 REPLY 1
David_Burnham
Super User (Alumni)

Re: Multi-User Access

Just to be clear, when you say "database" tables, you mean JMP tables?

 

I'm not aware of any ability to perform row locking - JMP is inherently single-user so I assume it doesn't have that ability.  This is what I do:

openSharedTable= Function({filePath},{default local},
	
	isLocked = 1;
	nAttempts = 200;
	delay = 0.1;
	attempts = 0;
	While(isLocked & attempts < nAttempts,
		attempts++;
		dt = open(filePath,Invisible);
		value = dt << Get Table Variable("Locked File");
		If (value=="",
			isLocked = 0
		,
			Close(dt,NoSave);
			Wait(delay);
		);
	);
	return(dt);
	
);
-Dave