-->
These old forums are deprecated now and set to read-only. We are waiting for you on our new forums!
More modern, Discourse-based and with GitHub/Google/Twitter authentication built-in.

All times are UTC - 5 hours [ DST ]



Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 2 posts ] 
Author Message
 Post subject: Getting Hibernate proxy for non lazy ToOne references
PostPosted: Thu Jun 16, 2011 6:18 am 
Newbie

Joined: Tue Apr 26, 2011 4:47 am
Posts: 4
Hi,

We are using Hebernate 3.6, JPA 2.0, Weblogic 10.3.4 (Oracle DB).
We encountered in a situation in our application when we get lazy proxy for ToOne reference which is marked as eager.
We also have set <property name="hibernate.max_fetch_depth" value="5"/> in peristence.xml (we set it on pupose to 5 to check a high limit).

The reference is fetched using paymentOperation.getParentTransaction().getDstUser()
What is strange is that paymentOperation.getParentTransaction().getSrcUser() which is mapped the same - is fetched not lazily

The mapping of the relevant entities and references is shown below:

@Entity
@Table(name="PAYMENT_OPERATIONS")
@RootEntity(PaymentOperation.class)
public abstract class PaymentOperation extends BaseTransaction {
@ManyToOne
private PaymentTransaction parentTransaction;
}

@Entity
@Table(name="PAYMENT_TRANSACTIONS")
@RootEntity(PaymentTransaction.class)
public abstract class PaymentTransaction extends Transaction {

@ManyToOne
private BaseUser dstUser;
}

Can you please assist me understand this issue?

Thanks,
Tovi


Top
 Profile  
 
 Post subject: Re: Getting Hibernate proxy for non lazy ToOne references
PostPosted: Mon Jun 27, 2011 7:01 am 
Newbie

Joined: Tue Apr 26, 2011 4:47 am
Posts: 4
Hi,

Would appriciate any kind of input about this. This causes unexpected behaior where we have lazy proxy where it should be eager.
What can be the cause for this?
Did similar thing happened to anyone?

Thanks again.


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 2 posts ] 

All times are UTC - 5 hours [ DST ]


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
© Copyright 2014, Red Hat Inc. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc.