-->
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: SELECT INTO command not allowed within multi-statement trans
PostPosted: Thu Sep 14, 2006 10:12 am 
Newbie

Joined: Wed Sep 13, 2006 10:35 am
Posts: 1
I am getting this exception. I have read some of the responses but did not get a perfect answer yet. One response say to update the server.xml with database configuration, but I don't want to do that.


Hibernate version: 3.0

Mapping documents:
Code:
<hibernate-mapping package="com.abc.xyz">
   <class name="com.abc.xyz.FundData">
      <id name="fundKey" column="fundKey"/>
      <property name="nasdaqSymbol" column="nasdaqSymbol"/>
      <property name="coreFundName" column="coreFundName"/>
   </class>
   <sql-query name="selectFundsForClass_SP">
       <return alias="funds" class="com.abc.xyz.FundData">
            <return-property name="fundKey" column="fundkey"/>
           <return-property name="nasdaqSymbol" column="nasdaqsymbol"/>
           <return-property name="coreFundName" column="corefundname"/>
       </return>
       {call getFundInfo(:siteId, :shareClass, :investType, :asOfDate, :asOfDtMonthly, :asOfDtQtrly, :asOfDtComp) }
   </sql-query>
</hibernate-mapping>

Java Code :
Code:
session = HibernateSessionFactory.currentSession();
         //session.connection().setAutoCommit(true);


//         tx = session.beginTransaction();
         
         fundDataList = session.getNamedQuery("selectFundsForClass_SP")
.setString("siteId",siteCode)
........................................
........................................
........................................).list();


Full stack trace of exception:
Code:

14 Sep 2006 08:29:49,124 [WARN ] org.hibernate.util.JDBCExceptionReporter - SQL Error: 226, SQLState: ZZZZZ
14 Sep 2006 08:29:49,124 [ERROR] org.hibernate.util.JDBCExceptionReporter - SELECT INTO command not allowed within multi-statement transaction.

14 Sep 2006 08:29:49,124 [WARN ] org.hibernate.util.JDBCExceptionReporter - SQL Error: 226, SQLState: ZZZZZ
14 Sep 2006 08:29:49,124 [ERROR] org.hibernate.util.JDBCExceptionReporter - SELECT INTO command not allowed within multi-statement transaction.

14 Sep 2006 08:29:49,140 [WARN ] org.hibernate.util.JDBCExceptionReporter - SQL Error: 226, SQLState: ZZZZZ
14 Sep 2006 08:29:49,140 [ERROR] org.hibernate.util.JDBCExceptionReporter - SELECT INTO command not allowed within multi-statement transaction.

14 Sep 2006 08:29:49,140 [WARN ] org.hibernate.util.JDBCExceptionReporter - SQL Error: 226, SQLState: ZZZZZ
14 Sep 2006 08:29:49,140 [ERROR] org.hibernate.util.JDBCExceptionReporter - SELECT INTO command not allowed within multi-statement transaction.

14 Sep 2006 08:29:49,140 [WARN ] org.hibernate.util.JDBCExceptionReporter - SQL Error: 226, SQLState: ZZZZZ
14 Sep 2006 08:29:49,140 [ERROR] org.hibernate.util.JDBCExceptionReporter - SELECT INTO command not allowed within multi-statement transaction.

14 Sep 2006 08:29:49,140 [WARN ] org.hibernate.util.JDBCExceptionReporter - SQL Error: 208, SQLState: 42000
14 Sep 2006 08:29:49,140 [ERROR] org.hibernate.util.JDBCExceptionReporter - #ytd_data_1 not found. Specify owner.objectname or use sp_help to check whether the object exists (sp_help may produce lots of output).

14 Sep 2006 08:29:49,156 [ERROR] com.db.core.biz.fund.FundService - could not execute query
14 Sep 2006 08:29:49,187 [DEBUG] com.db.core.biz.fund.FundService -


Name and version of the database: Sybase 12.5

Stored Procedure :
create procedure SPGetFundInfo
@site_id varchar(255),
@share_class varchar(255),
@investment_type varchar(255),
@as_of_date smalldatetime,
@as_of_date_monthly smalldatetime,
@as_of_date_quarterly smalldatetime,
@as_of_date_comparitive smalldatetime
as

--Daily Price data
select f.fund_key,
f.nasdaq_symbol,
f.core_fund_name,
fc.fund_cat,
into #temp1
from database1.dbo.fund f,
database2.dbo.fund_cat fc,
database2.dbo.fund_price fp
where f.entity = '0001'
and f.fund_cat = '1'
and f.share_class = 'A'
and f.fund_cat = fc.fund_cat
and fp.fund_key = f.fund_key


....................................
....................................
....................................
....................................
select .......................
into temp2 from #temp1, database1.dbo.ABC
where ...............


select * from #temp2

drop table #temp2

select @ios = @@error
if @ios != 0
return @ios

return


Thanks in advance


Top
 Profile  
 
 Post subject:
PostPosted: Tue Jul 03, 2007 1:21 pm 
Newbie

Joined: Wed Jun 23, 2004 4:35 pm
Posts: 13
Did you get an answer for this?

Thus far my understanding is that Sybase does not allow "SELECT INTO" in transactions. Everything Hibernate does is a transaction. (As is everything in my WebServer). Apparently we need a work around to get outside the transaction.


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.