logon service request refresh of credentials

Post any questions you have about using the Verj.io Studio, including client and server-side programming with Javascript or FPL, and integration with databases, web services etc.

Moderators: Jon, Steve, Ian, Dave

kotinkarwak
Ebase User
Posts: 109
Joined: Mon Sep 21, 2015 9:55 pm

logon service request refresh of credentials

#1

Postby kotinkarwak » Tue Feb 09, 2016 4:31 pm

I need to call the logon service again in a scenario where a logged in user is updating his/her profile data i.e. email address or tel number. In the logon service's script I have a line

tables.USERS_table.fetchTable();

which executes OK but doesn't now contain the new data already committed to database in the profiles submit button ( this is checked in the database and the data is now current)

I am tracing the execution and can see the calls happening when I re-display the page, the old information persists even though the update stored procedure completed ok and I can confirm that the database is current.

The question is, is this call permissible from the platform point of view or should I be asking user to logout/in for the changes to take effect?

Code: Select all

tables.CREDENTIAL.insertRow(); 
    tables.CREDENTIAL.ID.value="firstname"; 
    tables.CREDENTIAL.VALUE.value=tables.USERS_table.firstname.value; 

I have also tried to force a logoff after the profile commit and login again via code and still no joy.

sorry for the abstract nature of question.
0 x
ebasetech v5

Skype: mateso08
Location: Kenya

Jon
Moderator
Moderator
Posts: 1342
Joined: Wed Sep 12, 2007 12:49 pm

#2

Postby Jon » Tue Feb 09, 2016 5:35 pm

Your form and the logon service are running in separate threads and are treated as separate users by your database system. Because your form hasn't finished executing, the updated data is uncommitted and therefore won't be visible to the logon service (this stuff varies a bit according to which database you are using). To get around this problem, you need to commit the data after you have updated it i.e. enter

Code: Select all

system.transactionManager.commitAndRestartTransaction();
after the update but before the call to the logon service. Then the update will be visible to the logon service.

More info: transactions are handled automatically for you by the Ebase server. Normally a new transaction is started for each user request and is committed when the response is sent. You can override this behaviour e.g. by using the statement above.
0 x

kotinkarwak
Ebase User
Posts: 109
Joined: Mon Sep 21, 2015 9:55 pm

#3

Postby kotinkarwak » Wed Feb 10, 2016 11:24 am

Thanks jon. Works fine with that addition.
0 x
ebasetech v5

Skype: mateso08
Location: Kenya


Who is online

Users browsing this forum: No registered users and 4 guests