Hi,
I've got a quite big Table of User-Sessions with basically an ID and an END_TIME, for when the Session ends (a date).
Now, outside the Database, I've got an also quite big list of Session-IDs, that have to be kept alive, by updating the END_TIME. This list is in Java.
How would I do this in a nice and performant manner?
Would I use something like:
UPDATE active_sessions SET end_time=getdate() WHERE ( id=1 or id=2 or id=3 or id=4 ........... )
or submit a query for each single one, like:
UPDATE active_sessions SET end_time=getdate() WHERE (id=1)
UPDATE active_sessions SET end_time=getdate() WHERE (id=2)
........
Is there another way I can do that?
Because both options don't seem elegant to me.
Mind you, there are up to a couple of hundred IDs to update!
I would be grateful for any help.
I've got a quite big Table of User-Sessions with basically an ID and an END_TIME, for when the Session ends (a date).
Now, outside the Database, I've got an also quite big list of Session-IDs, that have to be kept alive, by updating the END_TIME. This list is in Java.
How would I do this in a nice and performant manner?
Would I use something like:
UPDATE active_sessions SET end_time=getdate() WHERE ( id=1 or id=2 or id=3 or id=4 ........... )
or submit a query for each single one, like:
UPDATE active_sessions SET end_time=getdate() WHERE (id=1)
UPDATE active_sessions SET end_time=getdate() WHERE (id=2)
........
Is there another way I can do that?
Because both options don't seem elegant to me.
Mind you, there are up to a couple of hundred IDs to update!
I would be grateful for any help.