-->
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.  [ 1 post ] 
Author Message
 Post subject: use "select .. into outfile 'file name' ..." with
PostPosted: Thu Jan 29, 2009 3:44 pm 
Newbie

Joined: Thu Jan 29, 2009 3:28 pm
Posts: 1
Hello, Hibernate Gurus,

I'm having some headaches with execution of the JPA query stem from the createNativeQuery method of EntityManager object

I have this massive amount of data that I want to output to a file directly by using MySQL's
"select .. into outfile 'file name' ..."

(if I don't, it will have Java run out of heap space and I don't want to page thru the results)


The query works fine in the database console.

but if I tried to execute the JPA query with

1. executeUpdate : it returns an exception saying that executeUpdate can't be used for chulk query or sth

2. getSingleResult : it will have the SQL statement automatically appended with ' limit 2' that results in an SQL syntax error.

3. getResultList : this is the only one that has the query executed. But it returns a GenericJDBCException, which will terminate my function calling stacks. I've tried to catch the particular exception and simply return within the exception catching block, still it triggers the rollback of transaction in my EJB module.

database : MySQL 4.0.27
hibernate core : hibernate-3.2
hibernate-entitymanager-3.4.0.GA

can someone kindly show me how to elegantly handle this situations?

thank you so much for any helps and hints


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

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.