try entityContext.getPrimaryKey() it works allways
I have also noticed this bug in Jboss 3.2.1. I have done some limited testing with JBoss 3.2.0 and haven't been able to reproduce the error
there so it seems to have been introduced with the 3.2.1 release.
Has a bug been entered for this?
I have also reproduced this in Jboss 3.2.1 (and the prior version 3.2.0). Using EntityContext.getPrimaryKey() and doing a findByPrimaryKey on that value is a work-around however it does add the overhead of an additional lookup.
Does anyone know if there is a bug entered for this?