-
Notifications
You must be signed in to change notification settings - Fork 46
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Scala 2.11 @transient's are null #187
Comments
That's expected, since they are transient, they aren't persisted.
That's interesting, could you share an isolated example of code that reproduces the issue? |
But shouldn't they be reevaluated after select? |
No, unless it's lazy. |
So what is the reason to have @transient vals at all? After select they are unusable. I think this is a bug. |
I've found more: all transient lazy val fields throw that exception but only if there is overridden transient lazy val toString. If it is tried to access transient lazy val field outside of transaction then this exception is thrown, not no transaction exception. It is also strange that it is required to have an active transaction to access lazy val field that already has all needed data. |
Okay, I'm correct, transient val fields got reevaluated on select. Can't reproduce that first part. |
After loading of object from DB all
@transient val
fields are null.lazy val
fields throwjava.lang.ClassCastException: java.lang.Boolean cannot be cast to java.lang.Byte
on access.I think it has something to do with scala 2.11 because it seems that similar issues were fixed before.
The text was updated successfully, but these errors were encountered: