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
  • I think you've explained the issue you're having already. Using session may not guarantee your scenario.
    Depending on session to manage database connection is not a good design practice in a session independent framework. By that, I mean that the sessions do not dictate the process. The Appian Engines persists data between events/transactions. Your architecture should focus on this feature.

    I suggest that when the user initiates the process, you pass in the preferred database as a parameter and use this within your design. This is the most straight-forward and easy way of handling your scenario. This will eliminate the need to manage sessions and avoid issues that may arise if a session times-out. No matter what session a user is on, the info about the selected database is now held as a process variable and you can use Expression builder to dynamically do operations.
    Hope this helps.
Reply
  • I think you've explained the issue you're having already. Using session may not guarantee your scenario.
    Depending on session to manage database connection is not a good design practice in a session independent framework. By that, I mean that the sessions do not dictate the process. The Appian Engines persists data between events/transactions. Your architecture should focus on this feature.

    I suggest that when the user initiates the process, you pass in the preferred database as a parameter and use this within your design. This is the most straight-forward and easy way of handling your scenario. This will eliminate the need to manage sessions and avoid issues that may arise if a session times-out. No matter what session a user is on, the info about the selected database is now held as a process variable and you can use Expression builder to dynamically do operations.
    Hope this helps.
Children
No Data