[jboss-user] [JBoss Seam] - booking example and db2

goik do-not-reply at jboss.com
Sun Jul 23 18:59:36 EDT 2006


Starting the  'booking' example with  1.0.1 GA I tried to configure a db2 DB server. Following http://wiki.jboss.org/wiki/Wiki.jsp?page=SetUpADB2Datasource I changed booking-ds.xml to:

<datasources>
  |     <local-tx-datasource>
  |         <jndi-name>bookingDatasource</jndi-name>
  |         <connection-url>jdbc:db2://localhost:10000/hdm</connection-url>
  |         <driver-class>com.ibm.db2.jcc.DB2Driver</driver-class>
  |         <user-name>midb2</user-name>
  |         <password>XXX</password>
  |         <min-pool-size>0</min-pool-size>
  | 
  |       <metadata>
  |          <type-mapping>DB2</type-mapping>
  |       </metadata>
  |     </local-tx-datasource>
  | </datasources>

My persistence.xml has an added DB2 dialect property:

<persistence>
  |    <persistence-unit name="bookingDatabase">
  |       <provider>org.hibernate.ejb.HibernatePersistence</provider>
  |       <jta-data-source>java:/bookingDatasource</jta-data-source>
  |       <properties>
  |          <property name="hibernate.hbm2ddl.auto" value="create-drop"/>
  |          <property name="hibernate.show_sql" value="true"/>
  |          <property name="hibernate.dialect" value="org.hibernate.dialect.DB2Dialect"/>
  |          <property name="hibernate.cache.provider_class" value="org.hibernate.cache.HashtableCacheProvider"/>
  |          <property name="hibernate.transaction.manager_lookup_class" value="org.hibernate.transaction.JBossTransactionManagerLookup"/>
  |       </properties>
  |    </persistence-unit>
  | </persistence>

Starting the application on jboss-4.0.4.GA app. server I can register a new user, browse the list of available hotels. When I try to create a reservation I can still reach the "confirmation" window.  But by clicking the "Confirm" button the application hangs. 

The corresponding log entries are:


00:09:44,726 INFO  [STDOUT] Hibernate: select user_.username, user_.name as name2_, user_.password as password2_ from User user_ where user_.username=?
  | 00:09:44,732 INFO  [STDOUT] Hibernate: insert into Booking (id, user_username, checkinDate, checkoutDate, hotel_id, creditCard, smoking, beds, creditCardName, creditCardExpiryMonth, creditCardExpiryYear) values (default, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)
  | 00:09:44,742 INFO  [STDOUT] Hibernate: values identity_val_local()
  | 00:09:44,747 INFO  [HotelBookingAction] New booking: 1 for goiki
  | 00:09:44,754 INFO  [STDOUT] Hibernate: select booking0_.id as id0_, booking0_.user_username as user10_0_, booking0_.checkinDate as checkinD2_0_, booking0_.checkoutDate as checkout3_0_, booking0_.hotel_id as hotel11_0_, booking0_.creditCard as creditCard0_, booking0_.smoking as smoking0_, booking0_.beds as beds0_, booking0_.creditCardName as creditCa7_0_, booking0_.creditCardExpiryMonth as creditCa8_0_, booking0_.creditCardExpiryYear as creditCa9_0_ from Booking booking0_ where booking0_.user_username=? order by booking0_.checkinDate
  | 00:14:44,739 WARN  [TransactionImpl] Transaction TransactionImpl:XidImpl[FormatId=257, GlobalId=goiki/32, BranchQual=, localId=32] timed out. status=STATUS_ACTIVE
  | 00:14:44,756 WARN  [TransactionImpl] Transaction TransactionImpl:XidImpl[FormatId=257, GlobalId=goiki/33, BranchQual=, localId=33] timed out. status=STATUS_ACTIVE


I can still access the 'User' and 'Hotel' tables via SQL. The 'booking' table cannot be accessed so there seems to be some sort of locked up transaction. There are definitely no other users accessing the RDBMS. Am I missing something?

My system: Linux Fedora core 5, DB2 UDB 8.2, IBM's standard JDBC driver, SUN's java 1.5.0_07-b03 .




View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=3960202#3960202

Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=3960202



More information about the jboss-user mailing list