Hey Julian,
each REST request opens it's own Oak session using the login command, so I
believe each node is created and versioned in its own thread and Oak
session.
For some of those requests I open an admin session, so there might be a
moment in time in which two threads are both opening a session as admin to
create and version different nodes. Is this a problem?

Jörg,
I do create the node and right after the very first version. I can try to
add some sort of sleep to be sure the check-in is done with a different
timestamp compared to the newly created node.

Marco.

On Thu, Dec 12, 2024 at 3:26 PM Julian Sedding <[email protected]> wrote:

> Good point about the same session being used in multiple threads. IIRC
> Sessions in Oak are not thread-safe (in practice, I believe they are
> thread-safe for reads, but not writes).
>
> Marco, it might be worthwhile exploring if the problem goes away when
> you use different sessions. Sessions in Oak are relatively cheap, so
> it should be ok to login/logout often.
>
> Julian
>
> On Thu, 12 Dec 2024 at 10:51, Jörg Hoh <[email protected]>
> wrote:
> >
> > HI Marco,
> >
> > If I read the code correct, it tries to create versions based on
> > timestamps, so not 2 versions (created by a single session) have the same
> > timestamp. Given non-granular timestamps (Windows would be problematic
> > here) and a high frequency of calls could lead to delays to arrive at the
> > next timestamp.
> >
> > Alternatively, can you check if you have a "jcr:date" with a timestamp in
> > the future in the node you want to checkin?
> >
> > Jörg
> >
> >
> >
> > Am Do., 12. Dez. 2024 um 08:40 Uhr schrieb Marco Piovesana <
> > [email protected]>:
> >
> > > Hi Jörg,
> > > yes I'm using the same session across multiple threads, multiple rest
> > > requests to be more precise. They're not done at high frequency though,
> > > they're requests coming from user's and the app was used by just a
> couple
> > > of them. The machine it's running Ubuntu 20.04.
> > >
> > > Marco.
> > >
> > > On Wed, Dec 11, 2024 at 11:20 PM Jörg Hoh <[email protected]
> .invalid>
> > > wrote:
> > >
> > > > Hi Marco,
> > > >
> > > > wild guess: Are you using the same session across multiple threads
> and
> > > > doing this operation at a high frequency? Are you running that on
> > > Windows?
> > > >
> > > > Jörg
> > > >
> > > > Am Mi., 11. Dez. 2024 um 14:26 Uhr schrieb Marco Piovesana <
> > > > [email protected]>:
> > > >
> > > > > Hi Manfred,
> > > > > here is the dump (I removed from the stacktrace the calls to our
> > > > > proprietary classes since I'm not sure what I can share about them)
> > > > >
> > > > > 2024-12-10 16:27:52
> > > > > Full thread dump OpenJDK 64-Bit Server VM (11.0.12+7 mixed mode):
> > > > > [...]
> > > > >
> > > >
> > > >
> > > > --
> > > > https://cqdump.joerghoh.de
> > > >
> > >
> > > --
> > >  <https://25.esteco.com>
> > >
> >
> >
> > --
> > https://cqdump.joerghoh.de
>

-- 
 <https://25.esteco.com>

Reply via email to