On Fri, 17 Nov 2000, marc fleury wrote:
> Dave, from your own stack...
>
> |> |[Bean Cache] Passivated overaged bean UserBean with id = null
>
> do you create a bean with id = null in your code ?
Hmmm... not on purpose. :)
> Then of course you get
>
> |> |[UserBean] java.lang.NullPointerException
> |> |[UserBean] at java.lang.reflect.Field.get(Native Method)
> |> |[UserBean] at
> |> |org.jboss.ejb.plugins.jaws.jdbc.JDBCCommand.getPkFieldValue(JDBCCom
>
> since your id (primary key or Pk) is null!!!!
Ok, I see where you're coming from.
> please double check where in your application you create a pk with id = null
> and then come back and say it works :)
I think it may be a problem due to a custom finder, but I'm not sure.
The test that causes this failure uses a custom finder on a CMP. Is
it possible the customer finder is not setting the primary key object
when it creates the entity beans?
The custom finder has the following signature:
User findByIdRange(int low, int high);
The finder SQL is basically:
SELECT * FROM user_table WHERE ID >= low AND ID <= high ORDER BY DESC
Of course I only specify the part after the WHERE and don't actually
know what it is selecting on. The only unusual aspect here is that
low and high are primary keys. I know this is not a realistic
example, but I wanted to try a quick custom finder just to see how all
the custom finder stuff works. I don't see at a high level why this
would cause a problem as long as the custom finder returns a bunch of
rows with the correct columns.
> we should throw exceptions on null create I guess, would prevent this ...
>
> Also I would be surprised if this disturbed JBoss in any way :) I mean it
> should just discard that instance and continue, did you see any discrepancy?
Once I get this TRANSACTION exception, I need to restart jBoss for any
queries to work. From that point on, I get the Load failed error an
any query.
-Dave
--
--------------------------------------------------------------
To subscribe: [EMAIL PROTECTED]
To unsubscribe: [EMAIL PROTECTED]
Problems?: [EMAIL PROTECTED]