-->
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: How to do Criteria based query with Read only?
PostPosted: Tue Nov 13, 2007 11:58 am 
Newbie

Joined: Tue Nov 13, 2007 11:52 am
Posts: 1
We are currently writing an application that reads data from a source
database, transforms it, and loads it into a target database. We are
using Hibernate only for reading from the source database (Oracle 10g).

I'm primarily concerned with increasing our reading speed.

Here are a few characteristics of our app:

* The Hibernate mappings were generated using Hibernate's reverse
engineering tools. They are essentially unmodified.
* We generally read data only once, and then send it to the target
database. (Thus, I'm not sure if caching would be of great benefit.)

One of our very specific questions revolves around using join fetching.
We suspect that using join fetching will improve our speed by reducing
the number of queries. We had been using HQL queries, but we are now
migrating some of these to Criteria queries. This is because, based on
our current understanding, we must use Criteria queries in order to
achieve join fetching.

When we use HQL queries, we consistently set
org.hibernate.SQLQuery.setReadOnly(true). However, I do not know how to
achieve the same effect when using Criteria queries.

In summary, I'm wondering how to use join fetching while maintaining the
setReadOnly(true) behavior.

Can you help us with this problem?


Top
 Profile  
 
 Post subject: Re: How to do Criteria based query with Read only?
PostPosted: Mon Oct 19, 2009 3:48 pm 
Newbie

Joined: Mon Jul 18, 2005 7:45 pm
Posts: 15
Location: Argentina
Why nobody answers such a simple question?
How hard could it be, the behavior is already supported in Query interface, porting to Criteria interface?


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.