Hello,
I am having a host of problems getting hibernate2.1.2 to work with DB2 7.2 on OS390. Below is info on the latest. I did a search on the sqlcodes and I am still lost. Any help is greatly appreciated!
Code:
_________________________________________
Session s = factory.openSession();
Transaction tx=null;
try {
s.setFlushMode(FlushMode.NEVER);
tx = s.beginTransaction();
Criteria crit = s.createCriteria(CrsInf.class);
List courses = crit.list();
Iterator iter = new HashSet(courses).iterator();
while ( iter.hasNext() ) {
CrsInf crs = (CrsInf) iter.next();
System.out.println( "Crs: " + crs.getTitle());
System.out.println();
tx.commit();
};
}
catch (Exception e) {
if (tx!=null) tx.rollback();
throw e;
}
finally {
s.close();
}
________________________________________________
StackTrace:
________________________________________________
C:\hibernate-2.1\NTDG\generated>java Main
Mar 15, 2004 2:44:49 PM net.sf.hibernate.cfg.Environment <clinit>
INFO: Hibernate 2.1.2
Mar 15, 2004 2:44:49 PM net.sf.hibernate.cfg.Environment <clinit>
INFO: loaded properties from resource hibernate.properties: {hibernate.connection.driver_class=com.ibm.db2.jcc.DB2Driver, hibernat
e.cglib.use_reflection_optimizer=true, hibernate.cache.provider_class=net.sf.hibernate.cache.HashtableCacheProvider, hibernate.cac
he.use_query_cache=true, hibernate.max_fetch_depth=1, hibernate.dialect=net.sf.hibernate.dialect.DB2Dialect, hibernate.jdbc.use_st
reams_for_binary=true, hibernate.jdbc.batch_size=0, hibernate.query.substitutions=true 1, false 0, yes 'Y', no 'N', hibernate.prox
ool.pool_alias=pool1, hibernate.connection.username=pickle, hibernate.connection.url=jdbc:db2://111.111.2.222:2323/DATABASE, hib
ernate.connection.password=xxxxx, hibernate.connection.pool_size=1}
Mar 15, 2004 2:44:49 PM net.sf.hibernate.cfg.Environment <clinit>
INFO: using java.io streams to persist binary types
Mar 15, 2004 2:44:49 PM net.sf.hibernate.cfg.Environment <clinit>
INFO: using CGLIB reflection optimizer
Mar 15, 2004 2:44:49 PM net.sf.hibernate.cfg.Configuration addClass
INFO: Mapping resource: CrsInf.hbm.xml
Mar 15, 2004 2:44:50 PM net.sf.hibernate.cfg.Binder bindRootClass
INFO: Mapping class: CrsInf -> CRS_INF
Mar 15, 2004 2:44:50 PM net.sf.hibernate.cfg.Configuration secondPassCompile
INFO: processing one-to-many association mappings
Mar 15, 2004 2:44:50 PM net.sf.hibernate.cfg.Configuration secondPassCompile
INFO: processing one-to-one association property references
Mar 15, 2004 2:44:50 PM net.sf.hibernate.cfg.Configuration secondPassCompile
INFO: processing foreign key constraints
Mar 15, 2004 2:44:50 PM net.sf.hibernate.dialect.Dialect <init>
INFO: Using dialect: net.sf.hibernate.dialect.DB2Dialect
Mar 15, 2004 2:44:50 PM net.sf.hibernate.cfg.SettingsFactory buildSettings
INFO: Maximim outer join fetch depth: 1
Mar 15, 2004 2:44:50 PM net.sf.hibernate.cfg.SettingsFactory buildSettings
INFO: Use outer join fetching: true
Mar 15, 2004 2:44:50 PM net.sf.hibernate.connection.DriverManagerConnectionProvider configure
INFO: Using Hibernate built-in connection pool (not for production use!)
Mar 15, 2004 2:44:50 PM net.sf.hibernate.connection.DriverManagerConnectionProvider configure
INFO: Hibernate connection pool size: 1
Mar 15, 2004 2:44:50 PM net.sf.hibernate.connection.DriverManagerConnectionProvider configure
INFO: using driver: com.ibm.db2.jcc.DB2Driver at URL: jdbc:db2://111.111.2.222:2323/DATABASE
Mar 15, 2004 2:44:50 PM net.sf.hibernate.connection.DriverManagerConnectionProvider configure
INFO: connection properties: {user=pickle, password=xxx}
Mar 15, 2004 2:44:50 PM net.sf.hibernate.transaction.TransactionManagerLookupFactory getTransactionManagerLookup
INFO: No TransactionManagerLookup configured (in JTA environment, use of process level read-write cache is not recommended)
Mar 15, 2004 2:44:51 PM net.sf.hibernate.cfg.SettingsFactory buildSettings
INFO: Use scrollable result sets: true
Mar 15, 2004 2:44:51 PM net.sf.hibernate.cfg.SettingsFactory buildSettings
INFO: Use JDBC3 getGeneratedKeys(): false
Mar 15, 2004 2:44:51 PM net.sf.hibernate.cfg.SettingsFactory buildSettings
INFO: Optimize cache for minimal puts: false
Mar 15, 2004 2:44:51 PM net.sf.hibernate.cfg.SettingsFactory buildSettings
INFO: echoing all SQL to stdout
Mar 15, 2004 2:44:51 PM net.sf.hibernate.cfg.SettingsFactory buildSettings
INFO: Query language substitutions: {no='N', true=1, yes='Y', false=0}
Mar 15, 2004 2:44:51 PM net.sf.hibernate.cfg.SettingsFactory buildSettings
INFO: cache provider: net.sf.hibernate.cache.HashtableCacheProvider
Mar 15, 2004 2:44:51 PM net.sf.hibernate.cfg.Configuration configureCaches
INFO: instantiating and configuring caches
Mar 15, 2004 2:44:51 PM net.sf.hibernate.impl.SessionFactoryImpl <init>
INFO: building session factory
Mar 15, 2004 2:44:51 PM net.sf.hibernate.impl.SessionFactoryObjectFactory addInstance
INFO: no JNDI name configured
Mar 15, 2004 2:44:51 PM net.sf.hibernate.cache.UpdateTimestampsCache <init>
INFO: starting update timestamps cache at region: net.sf.hibernate.cache.UpdateTimestampsCache
Mar 15, 2004 2:44:51 PM net.sf.hibernate.cache.QueryCache <init>
INFO: starting query cache at region: net.sf.hibernate.cache.QueryCache
Viewing all auction item objects
Hibernate: select this.YEAR as YEAR0_, this.TERM as TERM0_, this.CAMP as CAMP0_, this.CRS_NAM as CRS_NAM0_, this.CRS_NBR as CRS_NB
R0_, this.SECT as SECT0_, this.BEGIN_TIME as BEGIN_TIME0_, this.END_TIME as END_TIME0_, this.DAYS as DAYS0_, this.SSN as SSN0_, th
is.BLDG as BLDG0_, this.ROOM_NBR as ROOM_NBR0_, this.ROOM_SUFFX as ROOM_SUFFX0_, this.SUPPL_TITLE as SUPPL_T14_0_, this.ENRL_LIMIT
as ENRL_LIMIT0_, this.SEATS_OCCUP as SEATS_O16_0_, this.CR_HOURS as CR_HOURS0_, this.SHORT_NAM as SHORT_NAM0_, this.BLDG_DESC as
BLDG_DESC0_, this.EMAIL as EMAIL0_, this.TITLE as TITLE0_, this.DELIV_METH as DELIV_METH0_ from DWH.CRS_INF this where 1=1
Mar 15, 2004 2:44:51 PM net.sf.hibernate.util.JDBCExceptionReporter logExceptions
WARNING: SQL Error: -551, SQLState: 42501
Mar 15, 2004 2:44:51 PM net.sf.hibernate.util.JDBCExceptionReporter logExceptions
SEVERE: DB2 SQL error: SQLCODE: -551, SQLSTATE: 42501, SQLERRMC: PICKLE;SELECT;DWH.CRS_INF
Mar 15, 2004 2:44:51 PM net.sf.hibernate.util.JDBCExceptionReporter logExceptions
WARNING: SQL Error: -516, SQLState: 26501
Mar 15, 2004 2:44:51 PM net.sf.hibernate.util.JDBCExceptionReporter logExceptions
SEVERE: DB2 SQL error: SQLCODE: -516, SQLSTATE: 26501, SQLERRMC: null
Mar 15, 2004 2:44:51 PM net.sf.hibernate.util.JDBCExceptionReporter logExceptions
WARNING: SQL Error: -514, SQLState: 26501
Mar 15, 2004 2:44:51 PM net.sf.hibernate.util.JDBCExceptionReporter logExceptions
SEVERE: DB2 SQL error: SQLCODE: -514, SQLSTATE: 26501, SQLERRMC: SQL_CURLH200C1
Mar 15, 2004 2:44:51 PM net.sf.hibernate.util.JDBCExceptionReporter logExceptions
WARNING: SQL Error: -551, SQLState: 42501
Mar 15, 2004 2:44:51 PM net.sf.hibernate.util.JDBCExceptionReporter logExceptions
SEVERE: DB2 SQL error: SQLCODE: -551, SQLSTATE: 42501, SQLERRMC: PICKLE;SELECT;DWH.CRS_INF
Mar 15, 2004 2:44:51 PM net.sf.hibernate.util.JDBCExceptionReporter logExceptions
WARNING: SQL Error: -516, SQLState: 26501
Mar 15, 2004 2:44:51 PM net.sf.hibernate.util.JDBCExceptionReporter logExceptions
SEVERE: DB2 SQL error: SQLCODE: -516, SQLSTATE: 26501, SQLERRMC: null
Mar 15, 2004 2:44:51 PM net.sf.hibernate.util.JDBCExceptionReporter logExceptions
WARNING: SQL Error: -514, SQLState: 26501
Mar 15, 2004 2:44:51 PM net.sf.hibernate.util.JDBCExceptionReporter logExceptions
SEVERE: DB2 SQL error: SQLCODE: -514, SQLSTATE: 26501, SQLERRMC: SQL_CURLH200C1
Mar 15, 2004 2:44:51 PM net.sf.hibernate.JDBCException <init>
SEVERE: SQLException occurred
com.ibm.db2.jcc.c.SqlException: DB2 SQL error: SQLCODE: -551, SQLSTATE: 42501, SQLERRMC: PICKLE;SELECT;DWH.CRS_INF
at com.ibm.db2.jcc.c.cl.e(cl.java:1213)
at com.ibm.db2.jcc.c.cm.executeQuery(cm.java:279)
at net.sf.hibernate.impl.BatcherImpl.getResultSet(BatcherImpl.java:87)
at net.sf.hibernate.loader.Loader.getResultSet(Loader.java:795)
at net.sf.hibernate.loader.Loader.doQuery(Loader.java:189)
at net.sf.hibernate.loader.Loader.doQueryAndInitializeNonLazyCollections(Loader.java:133)
at net.sf.hibernate.loader.Loader.doList(Loader.java:950)
at net.sf.hibernate.loader.Loader.list(Loader.java:941)
at net.sf.hibernate.loader.CriteriaLoader.list(CriteriaLoader.java:118)
at net.sf.hibernate.impl.SessionImpl.find(SessionImpl.java:3571)
at net.sf.hibernate.impl.CriteriaImpl.list(CriteriaImpl.java:223)
at Main.viewAllAuctionsSlow(Main.java:44)
at Main.main(Main.java:77)
Exception in thread "main" net.sf.hibernate.JDBCException: SQLException occurred
at net.sf.hibernate.impl.SessionImpl.find(SessionImpl.java:3574)
at net.sf.hibernate.impl.CriteriaImpl.list(CriteriaImpl.java:223)
at Main.viewAllAuctionsSlow(Main.java:44)
at Main.main(Main.java:77)
Caused by: com.ibm.db2.jcc.c.SqlException: DB2 SQL error: SQLCODE: -551, SQLSTATE: 42501, SQLERRMC: PICKLE;SELECT;DWH.CRS_INF
at com.ibm.db2.jcc.c.cl.e(cl.java:1213)
at com.ibm.db2.jcc.c.cm.executeQuery(cm.java:279)
at net.sf.hibernate.impl.BatcherImpl.getResultSet(BatcherImpl.java:87)
at net.sf.hibernate.loader.Loader.getResultSet(Loader.java:795)
at net.sf.hibernate.loader.Loader.doQuery(Loader.java:189)
at net.sf.hibernate.loader.Loader.doQueryAndInitializeNonLazyCollections(Loader.java:133)
at net.sf.hibernate.loader.Loader.doList(Loader.java:950)
at net.sf.hibernate.loader.Loader.list(Loader.java:941)
at net.sf.hibernate.loader.CriteriaLoader.list(CriteriaLoader.java:118)
at net.sf.hibernate.impl.SessionImpl.find(SessionImpl.java:3571)
... 3 more
________________________________________
This is my mapping file:
________________________________________
<?xml version="1.0"?>
<!DOCTYPE hibernate-mapping PUBLIC
"-//Hibernate/Hibernate Mapping DTD 2.0//EN"
"http://hibernate.sourceforge.net/hibernate-mapping-2.0.dtd" >
<hibernate-mapping>
<class
name="CrsInf"
table="CRS_INF"
schema="DWH"
>
<composite-id name="comp_id" class="CrsInfPK">
<key-property
name="year"
column="YEAR"
type="java.lang.String"
length="4"
/>
<key-property
name="term"
column="TERM"
type="java.lang.String"
length="1"
/>
<key-property
name="camp"
column="CAMP"
type="java.lang.String"
length="3"
/>
<key-property
name="crsNam"
column="CRS_NAM"
type="java.lang.String"
length="4"
/>
<key-property
name="crsNbr"
column="CRS_NBR"
type="java.lang.String"
length="4"
/>
<key-property
name="sect"
column="SECT"
type="java.lang.String"
length="3"
/>
<key-property
name="beginTime"
column="BEGIN_TIME"
type="java.lang.String"
length="4"
/>
<key-property
name="endTime"
column="END_TIME"
type="java.lang.String"
length="4"
/>
<key-property
name="days"
column="DAYS"
type="java.lang.String"
length="5"
/>
<key-property
name="ssn"
column="SSN"
type="java.lang.String"
length="9"
/>
<key-property
name="bldg"
column="BLDG"
type="java.lang.String"
length="2"
/>
<key-property
name="roomNbr"
column="ROOM_NBR"
type="java.lang.String"
length="5"
/>
</composite-id>
<property
name="roomSuffx"
type="java.lang.String"
column="ROOM_SUFFX"
not-null="true"
length="1"
/>
<property
name="supplTitle"
type="java.lang.String"
column="SUPPL_TITLE"
not-null="true"
length="21"
/>
<property
name="enrlLimit"
type="short"
column="ENRL_LIMIT"
not-null="true"
length="5"
/>
<property
name="seatsOccup"
type="short"
column="SEATS_OCCUP"
not-null="true"
length="5"
/>
<property
name="crHours"
type="short"
column="CR_HOURS"
not-null="true"
length="5"
/>
<property
name="shortNam"
type="java.lang.String"
column="SHORT_NAM"
not-null="true"
length="15"
/>
<property
name="bldgDesc"
type="java.lang.String"
column="BLDG_DESC"
not-null="true"
length="70"
/>
<property
name="email"
type="java.lang.String"
column="EMAIL"
not-null="true"
length="50"
/>
<property
name="title"
type="java.lang.String"
column="TITLE"
not-null="true"
length="45"
/>
<property
name="delivMeth"
type="java.lang.String"
column="DELIV_METH"
not-null="true"
length="4"
/>
<!-- associations -->
</class>
</hibernate-mapping>
_______________________________________
|