Question

We have an issue, more often than I would like, where whether worker or client sessions crash and these sessions were in the process of using a number sequences to create a new record, but they end up blocking that number sequence literally and anyone else trying to create a record using the same sequence will have its client frozen.

When this happens, I usually go in the NUMBERSEQUENCELIST table, I spot the correct DataAreadId and the user, and delete the row whose Status = 1.

But this kind of annoying really. Is there anything, any way I can configure the AOS server to release number sequence when client/workers crash ?

For the worker sessions, I guess we can fine tweak the code which runs in them, but for the client sessions crashing, not much we can do...

Any ideas ?

Thanks!

EDIT: Turns out that in this situation, after restarting the AOS server, you can go in List in the number sequence menu, and clean it up. Prior to the restart, my client would freeze trying to do that. So no need to do it directly through SQL.

Was it helpful?

Solution

Continuous numbers in NumberSequenceList are automatically cleaned up every 24 hours (or as set up on the number sequence). The cleanup process is quite slow if there are many "dead" numbers (hundreds or thousands). This may be considered as a hang, but is not.

Things to consider:

  • Is a continuous number sequence needed?
  • Do the cleanup more frequent (say every half hour instead of the default 24 hour)
  • Setup the cleanup process as a batch process
  • Fix the bug in the client code using the number sequence

Also avoid reserving the number, just use it. Instead of the anti-pattern:

NumberSeq idSequence = NumberSeq::newGetNum(IntrastatParameters::numRefIntrastatArchiveID(), true);
this.IntrastatArchiveID = idSequence.num();
idSequence.used();

Just use the number:

this.IntrastatArchiveID = NumberSeq::newGetNum(IntrastatParameters::numRefIntrastatArchiveID()).num();

The makeDecisionLater parameter should only be used in forms, where user may decide not to use the number (by delete or by escape). And in that case the NumberSeqFormHandler class should be used anyway.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top