Duran (6) [Avatar] Offline
Hi all,

On pg 305 of EJB 3 in Action it says that most of the time leaving the name element out for the @PersistenceContext is fine,except in the unlikely event that it is declared at the class level...BUT 2 pages before that they use an example of @PersistenceContext used at the class level with only a unitName attribute?!?!?

Message was edited by:
dpanda (136) [Avatar] Offline
Re: @PersistenceContext(name="jndiName")
Are you referring to the side bar in page 307, it defines a name element too that is used at the class level because it uses the name to do the lookup!
Duran (6) [Avatar] Offline
Re: @PersistenceContext(name="jndiName")
Ah sorry,at the time of writing this I thought that class-level was the same place where we put instance variables...I understand now.