Since moving to a clustered environment, I noticed that is only aware of locks on the local node. Google turns up
a solution using Redis, but I wondered if anyone had suggestions from their
experience.
We use a datasource for session storage and include in our Application.cfc.
If we’re happy to throw an error in the case of a locking conflict, could
we implement our own solution by declaring a session variable, checking to
see if that variable exists before performing the code in the
block, then deleting the variable at the end of the block?
Thanks… Simon
Hi Simon,
so I guess you found this Github project from Ben Nadel GitHub - bennadel/CFRedlock: CFRedlock is a ColdFusion implementation of the Redlock distributed locking algorithm proposed by Redis.?
I can definitely recommend it, works great in our projects.
Cheers,
HarryVon: lucee@googlegroups.com [mailto:lucee@googlegroups.com] Im Auftrag von Simon Goldschmidt
Gesendet: Mittwoch, 13. Januar 2016 23:47
An: Lucee lucee@googlegroups.com
Betreff: [Lucee] Distributed lock management
Since moving to a clustered environment, I noticed that is only aware of locks on the local node. Google turns up a solution using Redis, but I wondered if anyone had suggestions from their experience.
We use a datasource for session storage and include in our Application.cfc.
If we’re happy to throw an error in the case of a locking conflict, could we implement our own solution by declaring a session variable, checking to see if that variable exists before performing the code in the block, then deleting the variable at the end of the block?
Thanks… Simon
You received this message because you are subscribed to the Google Groups “Lucee” group.
To unsubscribe from this group and stop receiving emails from it, send an email to lucee+unsubscribe@googlegroups.commailto:lucee+unsubscribe@googlegroups.com.
To post to this group, send email to lucee@googlegroups.commailto:lucee@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/lucee/2c8dac65-0e26-430b-a5d2-562246423c76%40googlegroups.comhttps://groups.google.com/d/msgid/lucee/2c8dac65-0e26-430b-a5d2-562246423c76%40googlegroups.com?utm_medium=email&utm_source=footer.
For more options, visit https://groups.google.com/d/optout.
The alternative we’re looking at is to use the database to manage the
locking. We replace the with the following:
update customer set address=address where customer='#session.customerid#'
block of locked code goes here
The update doesn’t do anything but lock the rows of the database relevant
to the session, so this has the same effect as
Simon