Transaction timeout

in the platform overview there is a discussion of transactions. There is no mention of when a transaction is cancelled because of inactivity or other action by the client (flushing cache, etc.).
if qodly is closely following the 4d model, then wouldn’t the transaction die when the session dies, or is there some underlying worker at play, and if there is, when does that die?

Hi mikey,

A Qodly app interacts with Qodly Server through REST requests. Such request can trigger Qodly Script code (dataclass member function or method). If this piece of code opens a transaction, and does not validate it, then the transaction is cancelled at the end of the REST request.
So this is not session related.

We may bring new behaviors in the future, but at this moment this is the way it works.

If I guess the use case behind your request: in some cases you have to collect user’s input in a front datasource (scalar, object, etc.) and submit it to a Qodly Server function to process it.


but…how long before the transaction is automatically cancelled?
if someone logs in, and a transaction is started, and the person walks away, then what?

the transaction can only be triggered by a QodlyScript function called through REST, for example from the UI. It will be cancelled as soon as this same function ends (unless it is validated in the function).

oh, yeah, that’s right, my bad.
i confused how transactions work with sessions and how we have to work around that.

no problem!
Not directly related to this topic, also remember that workers initiated from a given session will also not be session dependent: they continue to live until they end by themselves.

right - qodly is built on/with 4d, so expect a lot of similarities, even if there are some syntax differences, and the layout editor is primarily html/css/js/react/vue (vue, right?)
and i’m glad that we decided to use more of the js syntax for this. i thought when the class syntax was introduced, it should have diverged more from traditional 4d.


is there a === operator? it doesn’t look like it.

No there is not. It is a nice Idea !

i’m not sure if it is. 4d’s typing is stricter than js’s, so it can be hard to compare 4 with ‘4’ in 4d’s type system.