[Persistence, JBoss/CMP, Hibernate, Database] - LazyInitializationException when serialize entity in SOAP(XM
by jktinoco
Hi,
There are a common problem, when entities are linked in @OneToMany relationships with FetchType.LAZY attribute always a LazyInitializationException occurs when XML serializer tries to serialize it.
I think this happens because the XML serializer always access all entity's attributes and because the entity is attached to the hibernate's entity manager when XML serializer tries to serialize it.
LAZY fetch is very useful when we need to retrieve only some data from an entity and avoid to load all collections it have, if we use EAGER fetch all works perfectly but performance is seriously affected.
This behavior force to the developer to use ValueObject or Data Transfer Object pattern to avoid this problem, frequently developers need to transfer across the wire in SOAP protocol many entity objects and use one Value Object for every entity is expensive, it would be better use directly only entity beans.
Maybe if hibernate let us detach manually entities from the entity manager this problem go away and life can be more simple.
BEA introduces this extension in your implementation of JPA, Hibernate and JBoss could do it too.
If someone knows how i can avoid to use Value Objects in entities with LAZY fetch to serialize in SOAP your help will be very appreciated.
Thanks!!
Jair
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4084759#4084759
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4084759
18 years, 9 months
[JBoss Tools (users)] - EAR project validation errors
by lition
I installed JBoss Tools beta3 plugin from update site on eclipse 3.3 (already installed DTP 1.5 and WST 2.0.0).
After I create a new "Enterprise Application Project" an error occurs:
*** ERROR ***: Sat Sep 15 18:25:56 CEST 2007 org.eclipse.wst.validation.internal.core.ValidationException: IWAE0053E An internal error has occurred running validation on project:ProvaEAR]:ProvaEAR, check the log file for details
at org.eclipse.jst.j2ee.model.internal.validation.EarValidator.validateInJob(EarValidator.java:165)
at org.eclipse.jst.j2ee.internal.validation.UIEarValidator.validateInJob(UIEarValidator.java:226)
at org.eclipse.wst.validation.internal.operations.ValidatorJob.run(ValidatorJob.java:75)
at org.eclipse.core.internal.jobs.Worker.run(Worker.java:55)
My question is: can I work anyway by using JBoss Tools beta3 with eclipse SDK 3.3 or I have to go back to JBoss IDE beta2?
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4084758#4084758
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4084758
18 years, 9 months