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