-->
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.  [ 4 posts ] 
Author Message
 Post subject: Help, newbie db2/400
PostPosted: Thu Feb 24, 2005 2:48 pm 
Regular
Regular

Joined: Thu Feb 24, 2005 2:34 pm
Posts: 80
Sorry,
we have download the hibernate 3 beta4, i have some question to post.
Here there's my hibernate.cfg:

Code:
[list]
<?xml version="1.0"?>
<!DOCTYPE hibernate-configuration PUBLIC
"-//Hibernate/Hibernate Configuration DTD 3.0//EN"
"http://hibernate.sourceforge.net/hibernate-configuration-3.0.dtd">

<hibernate-configuration>
<session-factory>
<property name="connection.datasource">java:comp/env/jdbc/as400</property>
<property name="show_sql">true</property>
<property name="dialect">org.hibernate.dialect.DB2400Dialect</property>


<mapping resource="pf.hbm.xml"/>

</session-factory>
</hibernate-configuration>


here my  hbm:

<?xml version="1.0"?>
<!DOCTYPE hibernate-configuration PUBLIC
"-//Hibernate/Hibernate Configuration DTD 3.0//EN"
"http://hibernate.sourceforge.net/hibernate-configuration-3.0.dtd">

<hibernate-mapping>

   <class name="vo.as400.PfVO" table="sdgtwb_dat.aynau00f">
       
     <composite-id>
              <key-property name="stagpf" column="stag$a" type="string"/>
              <key-property name="modepf" column="mode$a" type="string"/>
              <key-property name="matepf" column="mate$a" type="string"/>
         </composite-id>

         <property name="de50pf">
                   <column name="dcol$a"/>
    </property>

         <property name="fl20pf">
                   <column name="FLAG$A"/>
    </property>


       

   </class>
</hibernate-mapping>
[/list]


When call in my java code SaveOrUpdate receive always this errors
Unexpected row count: 0 expected: 1

and the last question
why if in my table of db2/400 it's not under journal hibernate don't work?
Can you help me please,
Devis


Top
 Profile  
 
 Post subject: logs ?
PostPosted: Thu Feb 24, 2005 5:07 pm 
Newbie

Joined: Wed Feb 23, 2005 3:34 pm
Posts: 16
Location: Irving, Tx
Do you see the SQL in your logs?

If yes, have you tried to run the SQL from DB2 command-line?

What driver are you using? Are you running source locally or on a serer? (this could be a firewall issue)

My previos experience with 400 and persistence tools is that you need to override the generated SQL format to conform to: region.TableName. This can also affect the datasource getConnection logic. You may need to override the init SQL (in a properties file). Do this as the connection pool will test connection with this test-SQL prior to issuing connections. If it fails, it can result in an empty connection pool.


Top
 Profile  
 
 Post subject: hI
PostPosted: Fri Mar 04, 2005 10:31 am 
Regular
Regular

Joined: Thu Feb 24, 2005 2:34 pm
Posts: 80
hi ,
thank's for your help and sorry i'm replay only now
i have been ill ;_(.

curious, the problem was as I used the transactions,

well:

trasaction.Commit don't work

session.connection.Commit work well

Is it not strange also for you?
Bye Devis


Top
 Profile  
 
 Post subject:
PostPosted: Tue Apr 05, 2005 1:35 pm 
Beginner
Beginner

Joined: Wed Nov 24, 2004 10:54 am
Posts: 48
do you have journaling turn on for the physical file?


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 4 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.