Click here to Skip to main content
15,899,825 members

Comments by PGagliardi (Top 5 by date)

PGagliardi 15-Feb-23 13:24pm View    
Which kind of problems are you thinking about? Could you give me an example? Well, I understand one should examine the application in order to understand but i can tell you that is a very large and very complex web application first designed in 2008 on classic ASP and it's 15 years that uses the session end event with no issues at all. My first issue is that the customers (thousands) can generate pdf reports that are stored server-side in temp files, they have to be purged periodically in order to not saturate the storage (and they can be deleted only if the application is sure that the user doesn't need them anymore, naturally when logged out). The fact is that our typical web application mimic a desktop application, which was the target of ASP.Net Webforms, but we use a lot of custom code and no forms components at all, thus the migration to .Net core is not a problem apart from rethinking the session logic.
PGagliardi 15-Feb-23 4:53am View    
The session of course contains only anonymous data associated to the user (the session cookie), I only need to know when the session ends in order to perform cleaning and manteinance jobs. All the logic and data is on the server side. Moreover, if the system fails (could happen) the locking logic relies on a timestamp from which the system can assume the session is dead.
PGagliardi 27-Jun-17 8:34am View    
This sounds good! But can you provide a working example also for an UPDATE statement?

Tried this:

UPDATE mytable SET subscription = (CASE WHEN (SELECT COUNT(*) FROM mytable WHERE course=course_id) > max_reservations THEN 0 ELSE 1 END) WHERE id=id_subscription

but I got the following error:

"You can't specify target table 'mytable' for update in from clause".
PGagliardi 27-Jun-17 2:55am View    
Of course, but I have no practical experience in doing so and I don't know the risks, furthermore I have read that locking tables is not a suggested procedure,giving the fact that the best practice is to use transactions (but really I don't imagine how to define a transaction in this case).
PGagliardi 27-Jun-17 2:55am View    
Deleted
Of course, but I have no practical experience in doing so and I don't know the risks, furthermore I have read that locking tables is not a suggested procedure,giving the fact that the best practice is to use transactions (but really I don't imagine how to define a transaction in this case).