my problem is how i can initiate lazy loaded relation in service method
suppose this code snippet:
public Card getEmployeeActiveCard(long employeeNo) {
Employee employee= employeeDao.findByEmployeeNo(employeeNo)
for (Card card : employee.getCards()) { // LIE occurred here
if (card.isActive())
return card;
}
return null;
}
employee.cards is lazy-loaded relation and i'm in the same transaction, then
why i can not iterate cards!
DNewfield wrote:
>
> Matt Raible wrote:
>> If you're accessing this method as a web service - you should
>> initialize it on the server before passing it to the client.
>
> And more specifically, if some of the data is lazy loaded, you must
> cause that loading to happen before the session is closed.
>
> -Dale
>
--
View this message in context:
http://www.nabble.com/lazy-initialization-failure-%40-service-tf4762436s2369.html#a13621947
Sent from the AppFuse - User mailing list archive at Nabble.com.
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]