Fixed
Details
Details
Assignee
Michael Offner
Michael OffnerReporter
Adam Cameron
Adam CameronPriority
Fix versions
New Issue warning screen
Before you create a new Issue, please post to the mailing list first https://dev.lucee.org
Once the issue has been verified, one of the Lucee team will ask you to file an issue
Sprint
None
Affects versions
Created 9 April 2015 at 19:15
Updated 12 June 2020 at 17:32
Resolved 12 June 2020 at 17:32
Consider this code:
// Number.cfc component { static { number = 0 } public void function setNumber(number){ Number::number = number } public numeric function getNumber(){ return Number::number } }
// number.cfm number1 = new Number() number2 = new Number() dump(var={ number1 = number1.getNumber(), number2 = number2.getNumber() }, label="Initial state") number1.setNumber(42) dump(var={ number1 = number1.getNumber(), number2 = number2.getNumber() }, label="After updating via number1") dump(var={ number1 = Number::number, }, label="Direct access")
When I run this, I get:
Initial state Struct NUMBER1 number 0 NUMBER2 number 0 After updating via number1 Struct NUMBER1 number 42 NUMBER2 number 42 Direct access Struct NUMBER1 number 42
On subsequent hits to number.cfm, I get this:
Initial state Struct NUMBER1 number 42 <--- note the value reflects the previous change still NUMBER2 number 42 After updating via number1 Struct NUMBER1 number 42 NUMBER2 number 42 Direct access Struct NUMBER1 number 42
This is what I'd expect.
However on a couple of occasions when I've been distracted for some period of time (could be a coupla min, could be longer), and I reload that page, then the value has been reset to 0 again. This is different from the situation I detailed in issue [270].(https://bitbucket.org/lucee/lucee/issue/270). This is definitely with the "block" style syntax.
It does not seem to be based on a specific period of time (like some sort of timeout), because I've seen it in the space of a coupla minutes. However I've just left it sitting there for over half an hour, and cannot replicate. It has not been a one off though, I have seen it happen a few times whilst testing.
I dunno what else to look for by way of troubleshooting, TBH. Any ideas?