daoSession null in some daos

89 views
Skip to first unread message

Radhakrishna Nukareddy

unread,
Jul 11, 2012, 6:07:30 AM7/11/12
to gree...@googlegroups.com
We have 40 model classes. In 30 of the generated DAO's  attachEntity method is overridden. 
for the rest, entity.daosession in the corresponding entities is null.
This is causing "entity detached form context" exception even for entities that are just loaded from the db.

Any pointers why this might happen?
Thanks

Markus Junginger

unread,
Jul 11, 2012, 6:22:39 AM7/11/12
to gree...@googlegroups.com
Hmm, could you please post the relevant for for the exception? Seems odd that you even have access to methods throwing exceptions.

Entities must be made "active" to enable operations directly from the entity. Call youEntity.setActive(true) in the generator project. I think you confused the terms DAO and entity, because you seem to refer to the entity but write about DAO? Just to avoid misunderstandings...

Markus

Radhakrishna Nukareddy

unread,
Jul 11, 2012, 6:25:10 AM7/11/12
to gree...@googlegroups.com
Thanks Markus, will try to make to entities active
Reply all
Reply to author
Forward
0 new messages