Hi Everyone, We have a requirement where we need to Store data in Session O

Hi Everyone,
We have a requirement where we need to Store data in Session Object. I tried to fetch session object but i am getting error while fetching it.
So I tried storing data in servicecontext object using a custom function by using the following methods
sc.setAttribute(attributeName,AttributeValue) and sc.getAttribute(attributeName) . But they are not working as expected.Can any one suggest me how to fetch a session object or Any other alternate approach to store data in a session...

OriginalPostID-81082

OriginalPostID-81082

  Discussion posts and replies are publicly visible

Parents
  • Our project works on multiple database Instances(Say Db1,db2,db3,db4 etc). At home page user can choose the database instance he wants to work using dropdown and then he goes to the application . In the application all the transactions/work is done on the databaseInstance which user has selected. Most of the DB interactions are done using Executestoreprocedure Smartservice.We are storing the database names and their respective datasourcenames in constants. So based on the Database selected we are fetching the runtimedatasource from the constants.
    Now the problem is user wants to open a session and select one database(db1) and simultaneously he wants to open a new session and select another database(db2) and work on both of them at the same time. Initially we planned to store the “Selected database” in user’s custom fields but this approach doesnot work with multiple sessions.
    So we are planning to store the selected databaseInstance in Appian’s session. i hope i make the question clear.
Reply
  • Our project works on multiple database Instances(Say Db1,db2,db3,db4 etc). At home page user can choose the database instance he wants to work using dropdown and then he goes to the application . In the application all the transactions/work is done on the databaseInstance which user has selected. Most of the DB interactions are done using Executestoreprocedure Smartservice.We are storing the database names and their respective datasourcenames in constants. So based on the Database selected we are fetching the runtimedatasource from the constants.
    Now the problem is user wants to open a session and select one database(db1) and simultaneously he wants to open a new session and select another database(db2) and work on both of them at the same time. Initially we planned to store the “Selected database” in user’s custom fields but this approach doesnot work with multiple sessions.
    So we are planning to store the selected databaseInstance in Appian’s session. i hope i make the question clear.
Children
No Data