On Tue, 30 Nov 2004 09:48:17 -0500, inSys Developer <[EMAIL PROTECTED]>
wrote:

It seems as though if entry were null you would have a ClassCastException from the line above.

eh ? why should there be - casting null is totally ok! ;)

But besides that Gavin found that the code in DefaultSaveOrUpdateListener
contained
code that should not have been committed - so now it is reverted and I
have 100% green bar in HEAD as we speak ;)

/max

You probably would have to check if the object in the pesister cache is null even before casting to CacheEntry. What should the value of cachedState be if indeed entry is null.

null.

/max


Max Rydahl Andersen wrote:

On Tue, 30 Nov 2004 09:15:51 -0500, Gavin King <[EMAIL PROTECTED]> wrote:

Don't commit anything, I cannot reproduce your problem. All tests run perfectly for me!


well they don't for me :)

Even if I have a clear cvs checkout and go back a couple of commits.

I would appreciate if you looked over the small NP check if it makes sense!

/max


Max Rydahl Andersen wrote:

On Tue, 30 Nov 2004 09:48:29 +0100, Max Rydahl Andersen <[EMAIL PROTECTED]> wrote:

On Mon, 29 Nov 2004 20:58:30 -0600, Gavin King <[EMAIL PROTECTED]> wrote:

Not 23, but I just got 4 failures runnning against HSQLDB...

Anyone know why that is?



Your regressionfix for escapes made some of my errors go away (4-5 pcs).


but i still have this repeating NPE in DefaultSaveOrUpdateEventListener (on both HQL and Oracle)



I've looked into this and by adding a null check in DefaultSaveOrUpdateListener i'm down to 4 errors.


Index: event/DefaultSaveOrUpdateEventListener.java
===================================================================
RCS file: /cvsroot/hibernate/Hibernate3/src/org/hibernate/event/DefaultSaveOrUpdateEventListener.java,v retrieving revision 1.6
diff -u -r1.6 DefaultSaveOrUpdateEventListener.java
--- event/DefaultSaveOrUpdateEventListener.java 11 Nov 2004 20:57:23 -0000 1.6
+++ event/DefaultSaveOrUpdateEventListener.java 30 Nov 2004 13:47:11 -0000
@@ -257,7 +257,9 @@
if ( persister.hasCache() ) {
CacheEntry entry = (CacheEntry) persister.getCache()
.get( event.getRequestedId(), event.getSource().getTimestamp() );
- cachedState = entry.getState();
+ if(entry!=null) {
+ cachedState = entry.getState();
+ }
}


             event.getSource().addEntity(


This seems like a valid fix, as even though a persister has cache their might not be cachedentry in the cache, right ? (or am i missing something suttle, like there always should be an item in the cache at this point in code and the bug is really somewhere else ?)


I'll commit this if Gavin or Steve could verify who made these code lines that this is a valid fix.

/max


java.lang.NullPointerException
at org.hibernate.event.DefaultSaveOrUpdateEventListener.performUpdate(DefaultSaveOrUpdateEventListener.java:260) at org.hibernate.event.DefaultSaveOrUpdateEventListener.entityIsDetached(DefaultSaveOrUpdateEventListener.java:205) at org.hibernate.event.DefaultUpdateEventListener.performSaveOrUpdate(DefaultUpdateEventListener.java:31) at org.hibernate.event.DefaultSaveOrUpdateEventListener.onSaveOrUpdate(DefaultSaveOrUpdateEventListener.java:65) at org.hibernate.impl.SessionImpl.update(SessionImpl.java:628)
at org.hibernate.impl.SessionImpl.update(SessionImpl.java:644)
at org.hibernate.test.legacy.FooBarTest.testReuseDeletedCollection(FooBarTest.java:858) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) at java.lang.reflect.Method.invoke(Method.java:324)
at junit.framework.TestCase.runTest(TestCase.java:154)
at org.hibernate.test.TestCase.runTest(TestCase.java:121)
at junit.framework.TestCase.runBare(TestCase.java:127)
at junit.framework.TestResult$1.protect(TestResult.java:106)
at junit.framework.TestResult.runProtected(TestResult.java:124)
at junit.framework.TestResult.run(TestResult.java:109)
at junit.framework.TestCase.run(TestCase.java:118)
at junit.framework.TestSuite.runTest(TestSuite.java:208)
at junit.framework.TestSuite.run(TestSuite.java:203)
at junit.framework.TestSuite.runTest(TestSuite.java:208)
at junit.framework.TestSuite.run(TestSuite.java:203)
at junit.framework.TestSuite.runTest(TestSuite.java:208)
at junit.framework.TestSuite.run(TestSuite.java:203)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:421) at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:305) at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:186) if noone has a clue on what it is i'll have to rollback commits to find when it does not occur ;(


/max



-----Original Message-----
From: [EMAIL PROTECTED] on behalf of Max Rydahl Andersen
Sent: Mon 11/29/2004 7:09 AM
To: Hibernate development
Subject: [Hibernate] errors in alltest ?
Hi,


Am I the only one currently having 23 errors in the H3 AllTest suite from
current cvs on Oracle ?


They all seem to have their root in line 260 of
DefaultSaveOrUpdateEventListener where
I get a NPE.

















-- Max Rydahl Andersen callto://max.rydahl.andersen

Hibernate
[EMAIL PROTECTED]
http://hibernate.org

JBoss Inc
[EMAIL PROTECTED]
http://jboss.com


-------------------------------------------------------
SF email is sponsored by - The IT Product Guide
Read honest & candid reviews on hundreds of IT Products from real users.
Discover which products truly live up to the hype. Start reading now. http://productguide.itmanagersjournal.com/
_______________________________________________
hibernate-devel mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/hibernate-devel

Reply via email to