Advertisement
If you have a new account but are having problems posting or verifying your account, please email us on hello@boards.ie for help. Thanks :)
Hello all! Please ensure that you are posting a new thread or question in the appropriate forum. The Feedback forum is overwhelmed with questions that are having to be moved elsewhere. If you need help to verify your account contact hello@boards.ie
Hi there,
There is an issue with role permissions that is being worked on at the moment.
If you are having trouble with access or permissions on regional forums please post here to get access: https://www.boards.ie/discussion/2058365403/you-do-not-have-permission-for-that#latest

Alternatives to using session variables in ASP.net & C#

  • 28-09-2012 6:47pm
    #1
    Registered Users, Registered Users 2 Posts: 9,560 ✭✭✭


    I've noticed that session variables can be shared between browser sessions on a client if the same browser is used to open up multiple instances of the same website developed in ASP.net.

    This could be very problematic. What's the current thinking regarding session variables and IIS? Everyone seems to be saying to go stateless to facilitate server farms and the like, but in large enterprise systems it's sometimes handy to store SQL Server/Oracle transaction items in session variables so you can roll-back if the user doesn't want to commit on a multi-table insert/update.

    Thanks!


Comments

  • Registered Users, Registered Users 2 Posts: 2,781 ✭✭✭amen


    SQL Server/Oracle transaction items in session variables so you can roll-back if the user doesn't want to commit on a multi-table insert/update

    How long are you keeping these transactions in call for ?

    You do realise that doing this could negatively affect the DB performance and cause deadlocks.


  • Registered Users, Registered Users 2 Posts: 9,560 ✭✭✭DublinWriter


    amen wrote: »
    How long are you keeping these transactions in call for ?

    You do realise that doing this could negatively affect the DB performance and cause deadlocks.
    Minutes and yes.


  • Registered Users, Registered Users 2 Posts: 11,989 ✭✭✭✭Giblet


    You should probably be looking at Transaction Per Request, or even using an ActionFilter to handle it (MVC). Why are you persisting a transaction over multiple requests? If you are creating an inconsistent state in the Database for a long duration, you may need to think about exactly why you are doing that. Surely you would have problems with transaction scopes?


  • Moderators, Society & Culture Moderators Posts: 9,689 Mod ✭✭✭✭stevenmu


    Are you actually holding a DB transaction open across requests/page loads, or just building up the values for the transaction in your session variables?


Advertisement