Hi,

I came upon this problem when looking at the hibernate queries that JBoss AS 
executes for bi-directional relations (i.e. parent-child).

The problem is that when a method of a session bean is called and in that 
method a parent entity bean is used, then after finishing the method the server 
will execute a ton of select statements for the children.
My guess, to merge or update the children.

But seeing as I only access properties, I would like a way to stop this 
automatic update of the children.

If anyone knows a way, I'm all ears.


The annotations for parent and children I use now look as follows:



  | 
  | // in the parent entity bean
  | 
  |     @OneToMany(targetEntity=ChildBean.class, 
  |                     mappedBy="parent", 
  |                     cascade=CascadeType.ALL,
  |                     fetch=FetchType.LAZY)
  |     private List<ChildBean> children;
  | 
  | 
  | // int the child entity bean
  | 
  |     @ManyToOne(targetEntity=ParentBean.class, fetch=FetchType.LAZY)
  |     @JoinColumn(name="parent_id", nullable = false)
  |     private ParentBean parent;
  | 
  | 

View the original post : 
http://www.jboss.com/index.html?module=bb&op=viewtopic&p=3914186#3914186

Reply to the post : 
http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=3914186


-------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc. Do you grep through log files
for problems?  Stop!  Download the new AJAX search engine that makes
searching your log files as easy as surfing the  web.  DOWNLOAD SPLUNK!
http://ads.osdn.com/?ad_id=7637&alloc_id=16865&op=click
_______________________________________________
JBoss-user mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/jboss-user

Reply via email to