-->
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.  [ 1 post ] 
Author Message
 Post subject: how to set datasource in websphere 5.1 to connect Postgres 7
PostPosted: Mon Mar 14, 2005 6:32 pm 
Newbie

Joined: Mon Mar 14, 2005 5:34 pm
Posts: 1
I am new to Hibernate and using version 3 with Websphere 5.1 and Postgres db 7.3.
I got two problems:
1. When hibernate starts up, it could not validate the VendorBean class and generate this error:

org.hibernate.cfg.HbmBinder Could not perform validation checks for component as the class com.palliser.VendorBean was not found

Here is my mapping:

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

<hibernate-mapping>
<class
name="com.VendorBean"
table="vendor"
>
<composite-id>
<key-property
name="vendornum"
column="vendornum"
type="java.lang.String"
length="10"
>
</key-property>
<key-property
name="vendorname"
column="vendorname"
type="java.lang.String"
length="32"
>
</key-property>
</composite-id>
</class>
</hibernate-mapping>

The class VendorBean and the VendorBean.hmb.xml are both in WEB-INF/class/com/

2. I am setting up a DS in websphere 5.1 and keep gettings

Caused by: Transaction isolation level 4 is not supported.
at org.postgresql.jdbc1.AbstractJdbc1Connection.setTransactionIsolation(AbstractJdbc1Connection.java:1124)

Here are my settings in websphere:

JDBC Provider:
classname: org.postgresql.jdbc3.Jdbc3ConnectionalPool
classpath:pg73jdbc3.jar

Datasource:
Name: pgdsd
jndi name: jdbc/postgres
data source helpder classname: com.ibm.websphere.rsadapter.ConnectJDBCDataStoreHelper
Connection timeout:1800
Max connection:10
....

PropertyName Value Type
serverName servername java.lang.String
databaseName dbname java.lang.String
portNumber 5432 java.lang.Integer
user userid java.lang.String
password password java.lang.String
defaultAutoCommit: false java.lang.Boolean
enable2Phase false java.lang.Boolean

And in my hibernate.cfg.xml:


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

<hibernate-configuration>

<session-factory name="postgresSession">
<property name="connection.datasource">java:comp/env/jdbc/pgtest</property>
<property name="show_sql">true</property>
<property name="dialect">org.hibernate.dialect.PostgreSQLDialect</property>
<property name="transaction.factory_class">org.hibernate.transaction.JTATransactionFactory</property>
<property name="connection.isolation">2</property>
<property name="transaction.manager_lookup_class">org.hibernate.transaction.WebSphereTransactionManagerLookup</property>
<!-- mapping -->
<mapping resource="com/palliser/VendorBean.hbm.xml"/>
</session-factory>
</hibernate-configuration>


Thanks for any help.


thnguyen


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 1 post ] 

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.