Does that help In PHP, you can't access static class properties in object context. Instead of $this, you need to use self or static keyword, or the class name, coupled with :: operator instead of ->. So, in your example, it's enough to change this line:
I think the issue was by ths following , If you're using active record then a unique sequential id (id) is already created by default and takes care of all concurrency issues for you. If you need to use it for queries then a separate column might be the way forward, but if you just need to display it in a certain format you could simply define a method on your model like:
"ABC%.5d" % id
test = MyModel.create
test.id #=> 1
test.my_unique_id #=> "ABC00001"
test2 = MyModel.create
test2.id #=> 2
test2.my_unique_id #=> "ABC00002"
acts_as_sequenced scope: :institute_id, column: :sequential_id
Force sequential evaluation for non thread-safe Consumer in Java
hope this fix your issue There is no way of enforcing a single-threaded use of your Consumer, at least not without an overhead in the same order of magnitude than just making the Consumer thread safe. But it is not the responsibility of the Consumer to enforce a single-threaded usage. In Java, not being thread safe is the norm for mutable classes, say StringBuilder, ProcessBuilder, ArrayList, HashMap, any kind of iterator, DecimalFormat, to name some examples of widely used mutable classes which are not thread safe and not enforcing a single threaded use.
How to guarantee thread safe for 2 sequential statements in java?