How to do simultaneous processing of different in a single transaction?


Warning: count(): Parameter must be an array or an object that implements Countable in /home/styllloz/public_html/qa-theme/donut-theme/qa-donut-layer.php on line 274
0 like 0 dislike
13 views
Hi. Faced with the interesting puzzles associated with the transaction, maybe someone will tell you.
The task is to track the number of user visits and length of visits.
There is a web application (now in spring). He has a mini API with one controller which is knocking a few users.
There are different variants of behavior of the user:
1. Optimistic. The user can knock on the door and after the door opens he will enter. For the release, he is obliged again to knock on the castle doors open and he then leaves.
2. Normal. When you try to log in/out user may knock once, twice, three times then the door will open and only after that will actually be able to leave/come in.
3. Difficult situation. User "A" can knock to come in, otkroetsa the door, and leaves the user "B" and then only "A" will drop (of course it had not knocked on and how would we track that he came without knocking).
4. Life's a pain. The user can knock on - the door opens, he comes staggering when you walk, when you walk in, but in the end he most likely will go (the same behavior when you exit). You need to visit save first "entrance" and the last "exit" of the user.

The problem is that each request comes in a new thread (servlet-api without asynchrony) and each request is processed in a particular "way" in the same transaction and in the end create a "visit" and assigned to it the entry with the input/output of the user. Are there any recommendations how to do so in the processing requestor all user of hard labor tied to the visit and it did not create extra visits and not doing post processing visits (e.g. every 5 min. quartz or equivalent)?

I apologize in advance for the "many letters"
by | 13 views

2 Answers

0 like 0 dislike
But with the client to send the message that I(the user) came in and I'm still active not an option?
If forgot to log off, then this message will not come.
by
0 like 0 dislike
On account of the duration of the visits, there's not much advise. But for the number of visits, please.
When first entering the website, I put it to supercook, a month or a year.
1) Read the supercook or generated by it if such was not
2) all logs probressive this supercook.
3) While processing the log looking for object with this supercookie and fill it up with information who, when, and under what name. what browser or client, etc., Associated with the user supercoco.
In other words, we have and supercook and the user, and it does not matter, he went in, came out, went somewhere, etc.

PS. On the schem residence time on the website, make an ajax timer that works off of 5, 10, 30 sec and 1, 3, 5 minutes, knocking on the endpoint, and supercook will be included with the request. In this way, even bots you can catch that work without JS (which JS also caught),
by

Related questions

0 like 0 dislike
1 answer
0 like 0 dislike
1 answer
0 like 0 dislike
1 answer
0 like 0 dislike
1 answer
110,608 questions
257,186 answers
0 comments
36,634 users