[jboss-user] [JBoss Seam] - slow queries using lobs in entities
koatto
do-not-reply at jboss.com
Fri Feb 16 06:04:30 EST 2007
I have a problem querying an entity with a lob property, thats my entity's definition :
| @Entity
| public class File{
| @Id @GeneratedValue(strategy=GenerationType.AUTO)
| long code ;
| @ManyToOne
| Person person = null;
| Date timestamp = Calendar.getInstance().getTime();
| String fileName = "";
| @OneToOne
| User creator = null;
| @OneToOne
| User lastUpdater = null;
| String description = "";
| @Lob @Basic(fetch = FetchType.LAZY)
| Blob contents = null;
|
| ...geters/setters
| }
|
and that's the way a query the objects :
List<File> results =entityManager.createQuery(" from File f").getResultList();
entityManager is injected from the seam's context.
I'm using mysql with mysql inno dialect, the query is very very slow and very memory consuming cause hibernate includes the lob field into the sql.
What am i not doing in the right way?
thanks.
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4017550#4017550
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4017550
More information about the jboss-user
mailing list