Discussions
Categories
Groups
Community Home
Categories
INTERNAL ENABLEMENT
POPULAR
PUBLIC CLOUD
PRIVATE CLOUD
Quick Links
MY LINKS
HELPFUL TIPS
Back to website
Home
Intelligence (Analytics)
Lock mechanism on using of chart
cdoniat
Hi everyone and Birt Guru,
Does anyone try to manage some lock mechanism on the report generation by several users ? I mean, in a collaborative way, several users can use the same report at the same moment. BUT, it should not! Otherwise each user can trigger the same SQL request with different parameters values; As the result, the last user who trigger sql resquest could obtain its outcome and the rest of them obtain some wrong outcome.
Well, the idea is to use a Mutex table which contains the list of reports (id, label, lock status) so that it possible to block the using of the leaded report by the other users until its outcome. Well I implemented this. I would like to get the value of the lock status from a dataset on the Mutex table from the onFetch js script, store it in the persistent global variable. Then use this lastest to inform the status to the next user;
I did like that in onFetch of Mutex dataset :
this.queryText = "SELECT id,Label,Lock_status FROM BIRT_Mutex WHERE id = 6;";
reportContext.setPersistentGlobalVariable("lockStatus",new Number(row.getColumnValue("Lock_status")));
reportContext.setPersistentGlobalVariable("id",new Number(row.getColumnValue("id")));
reportContext.setPersistentGlobalVariable("label",new String(row.getColumnValue("Label")));
After that, I initialized a text element in the report and I associated the following script in onRender:
var lockStatus = reportContext.getPersistentGlobalVariable("lockStatus");
var id = reportContext.getPersistentGlobalVariable("id");
var label = reportContext.getPersistentGlobalVariable("label");
this.text = "lockStatus value = " + lockStatus + ";" + id + ";" + label;
So the values are all null.
Any idea or clue to help me? What is it missing?
Regards,
Christophe
Find more posts tagged with
Comments
Hans_vd
<blockquote class='ipsBlockquote' ><p>Otherwise each user can trigger the same SQL request with different parameters values</p></blockquote>
I don't see the problem.<br />
Every database that I am aware of can perfectly handle that.<br />
<br />
Regards<br />
Hans