This one time, at band camp, Stein M. Eliassen said:
SME>Bruce Snyder wrote:
SME>> This one time, at band camp, Stein M. Eliassen said:
SME>>
SME>> SME>Is it a known bug when attempting to load a previous deleted object
SME>> SME>before it's removed from the cache that a
SME>> SME>"TransactionNotInProgressException: This transaction is not open" is thrown?
SME>>
SME>> Not that I'm aware of. Please post the relevant portion of your
SME>> client code, Stein. I want to see the sequence of events.
SME>>
SME>
SME>I changed my strategy, but the problem persisted so I dug around and
SME>found out it was something else :-\
SME>
SME>I have a User-type with an email-adress with getter and setter method,
SME>but I also have a method 'hasEmail' to check if the user-instance have
SME>an email instead of using 'user.getEmail().length() > 0'.
SME>
SME>When this method returns false the getter-method returns just an empty
SME>string "" and here is the problem, but I don't know if it is a bug or
SME>design by choice.
SME>
SME>FieldMolder.getValue returns 'null' when my hasEmail returns false and
SME>then the field is set to NULL in the database. Then a
SME>TransactionNotInProgressException is thrown when I call commit().
SME>
SME>Relevant code in FieldMolder.getValue is:
SME>// If field has 'has' method, false means field is null
SME>// and do not attempt to call getValue. Otherwise,
SME>if ( object == null ||
SME> ( rf._hasMethod != null && ! ( (Boolean) rf._hasMethod.invoke(
SME>object, null ) ).booleanValue() ) )
SME> return null;
SME>else
SME> return rf._getMethod.invoke( object, null );
SME>
SME>I'm using Eclipse for IDE so renaming 'hasEmail' to 'hasEmailAdress' was
SME>a breeze and the code is working as expected :-)
SME>
SME>Is it a bug or feature?
The logic from the FieldMolder.getValue() method is correct. What does not
seem to be correct is your receipt of a TransactionNotInProgressException.
This exception is only thrown from within the DatabaseImpl. Please post
the relevant portion of your client code so that I can see the sequence
of events that is causing this to occur.
Bruce
--
perl -e 'print unpack("u30","<0G)[EMAIL PROTECTED]&5R\"F9E<G)E=\$\!F<FEI+F-O;0\`\`");'
The Castor Project
http://www.castor.org/
Apache Geronimo
http://incubator.apache.org/projects/geronimo.html
-----------------------------------------------------------
If you wish to unsubscribe from this mailing, send mail to
[EMAIL PROTECTED] with a subject of:
unsubscribe castor-dev