Re: ColumnCacheTest fails in findOrCreate()
Anthony & Melissa Berglas <[email protected]>
| Newsgroups | gmane.comp.java.orm.simpleorm |
|---|---|
| Message-ID | <[email protected]> |
Hello Franck,
Your fix looks OK.
Note that you have not checked your change in. I have made it again,
make sure we don't check in twice.
My underlying change is that the database version of the values is
always available, even if optimistic locking is not used. This
could be useful in validation, and also allows code like
Total += newValue - oldValue.
Have you reviewed all the changes that I made to the validation
framework? I have also added and Enum to Employee. And all the
validators are tested at least once.
See also the to do list at the top of ChangesByFranck.
I am working on the white paper. I soon want to move the branch code to head.
Anthony
At 02:16 AM 30/07/2008, Franck Routier wrote:
>Hi Anthony,
>
>the tests fail right now in ColumnCacheTest at line 126
>(findOrCreateTest) if the Driver supportsLocking().
>
>I guess this is why you didn't catch it with Hsql.
>
>To make it pass, I have changed the code in
>SRecordInstance.setOptimistic(boolean) to this:
>
>public void setOptimistic(boolean optimistic) {
>if (!isOptimistic && isDirty() && !isNewRow() && optimistic) // new
>will always be dirty, but as insert should be ok.
>throw new SException.Error("Cannot make dirty record optimisitic " +
>this);
>isOptimistic = optimistic;
>}
>
>So I added the '&& optimistic', as calling setOptimistic(false) was
>failing.
>
>Does it seem right to you ? (if so I'll commit)
>
>Franck
>
>
Spreadsheet Detective,
Southern Cross Software Queensland Pty Limited
54 Gerler Street
Bardon, Queensland 4065, Australia.
Email: [email protected]
www.SpreadsheetDetective.com
Ph: +61 427 830248 (Australian Eastern Standard Time)
"If the model seems correct only because the numbers look right,
then why build the model in the first place?"
------------------------------------
Yahoo! Groups Links
<*> To visit your group on the web, go to:
http://groups.yahoo.com/group/SimpleORM/
<*> Your email settings:
Individual Email | Traditional
<*> To change settings online go to:
http://groups.yahoo.com/group/SimpleORM/join
(Yahoo! ID required)
<*> To change settings via email:
mailto:[email protected]
mailto:[email protected]
<*> To unsubscribe from this group, send an email to:
[email protected]
<*> Your use of Yahoo! Groups is subject to:
http://docs.yahoo.com/info/terms/
13cf6723.jpg
(image/jpeg, 3.3 KB) - not displayed