Jon,
Thanks for the info.  I seemed to have 'fixed' my problem as well, although 
I'm not sure what I did to fix it.  I built a new JBoss from this morning's 
CVS, using jdk1.4 (due to that horrible "protected instance variable not seen 
by subclasses' inner classes" bug in jdk 1.3) and now the exception has gone 
away.  I'm not convinced it won't show up again, but at least for now 
development may proceed.  I'll definitely keep your findings in mind when 
writing custom finders.
Justin

> Well Justin, I have solved the issue, although I think this may qualify for
> a bug.  Basically, it boils down to returning null in a custom finder.  I
> couldn't find documentation on implementing a custom finder in which a
> single record was returned instead of a Collection.  The method signiture
> for a custom finder returning a Collection in the JBossCMP book does not
> include "throws FinderException" so I wrongly assumed that it couldn't have
> one.  I thought that returning null would do the trick.  I was wrong.
>
> When JBoss gets a null back from the custom finder, it generates a not null
> object and returns.  Any call on this object results in the tx error.  It
> is conceivable that you are experiencing the same issue if your finder
> returns a null PK within the collection.  The fix for me was to throw a
> FinderException in the custom finder when the row was not found.
>
> Obviously, I am in error in that I did not know the proper way to specify a
> no result in the customer finder.  However, I think JBoss should handle
> this a little better given that it is not that hard to create.  Maybe JBoss
> should throw a FinderException if the custom finder returns null or a
> non-valid PK (i.e. not in DB).  I guess it is concievable to have a null as
> a valid PK value (although I would shot any developer of mine who did
> that).  Even if you do not want to take the hit and check the DB for a
> valid value right away, when a method call is made, a Tx error complicates
> things.  Even returning a NULL object would have been better I think.



_______________________________________________________________

Don't miss the 2002 Sprint PCS Application Developer's Conference
August 25-28 in Las Vegas -- http://devcon.sprintpcs.com/adp/index.cfm

_______________________________________________
JBoss-user mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/jboss-user

Reply via email to