File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Object Relational Mapping and the fly likes Hibernate DB2 Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Spring in Action this week in the Spring forum!
JavaRanch » Java Forums » Databases » Object Relational Mapping
Bookmark "Hibernate DB2" Watch "Hibernate DB2" New topic
Author

Hibernate DB2

Mahima Singh
Greenhorn

Joined: May 16, 2007
Posts: 26
Hi! all

i was using COM.ibm.db2.jdbc.app.DB2Driver and was getting following exception :

10:57:18,124 WARN BasicResourcePool:1222 - com.mchange.v2.resourcepool.BasicResourcePool$AcquireTask@966905 -- Acquisition Attempt Failed!!! Clearing pending acquires. While trying to acquire a needed new resource, we failed to succeed more than the maximum number of allowed acquisition attempts (30).

10:57:18,124 WARN BasicResourcePool:1222 - com.mchange.v2.resourcepool.BasicResourcePool$AcquireTask@c8ccb1 -- Acquisition Attempt Failed!!! Clearing pending acquires. While trying to acquire a needed new resource, we failed to succeed more than the maximum number of allowed acquisition attempts (30).

10:57:18,202 WARN SettingsFactory:109 - Could not obtain connection metadata

java.sql.SQLException: Connections could not be acquired from the underlying database!

at com.mchange.v2.sql.SqlUtils.toSQLException(SqlUtils.java:104)

at com.mchange.v2.c3p0.impl.C3P0PooledConnectionPool.checkoutPooledConnection(C3P0PooledConnectionPool.java:236)

at com.mchange.v2.c3p0.PoolBackedDataSource.getConnection(PoolBackedDataSource.java:94)

at org.hibernate.connection.C3P0ConnectionProvider.getConnection(C3P0ConnectionProvider.java:35)

at org.hibernate.cfg.SettingsFactory.buildSettings(SettingsFactory.java:76)

at org.hibernate.cfg.Configuration.buildSettings(Configuration.java:2006)

at org.hibernate.cfg.Configuration.buildSessionFactory(Configuration.java:1289)

at com.ibm.tmds.model.persistence.PersistenceEnvBaseImpl.createSessionFactory(PersistenceEnvBaseImpl.java:90)

at com.ibm.tmds.model.persistence.PersistenceEnvBaseImpl.<init>(PersistenceEnvBaseImpl.java:43)

at com.ibm.tmds.model.persistence.PersistenceEnvBaseImpl.getInstance(PersistenceEnvBaseImpl.java:53)

at com.ibm.tmds.model.persistence.PersistenceAdapterForHibernate.startPersistenceEnvironment(PersistenceAdapterForHibernate.java:51)

at com.ibm.tmds.model.persistence.PersistenceAdapterForHibernate.<clinit>(PersistenceAdapterForHibernate.java:43)

at com.ibm.tmds.view.util.TMDSStart$1.run(TMDSStart.java:600)

at java.awt.event.InvocationEvent.dispatch(InvocationEvent.java:209)

at java.awt.EventQueue.dispatchEvent(EventQueue.java:461)

at java.awt.EventDispatchThread.pumpOneEventForHierarchy(EventDispatchThread.java:242)

at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:163)

at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:157)

at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:149)

at java.awt.EventDispatchThread.run(EventDispatchThread.java:110)

Caused by: com.mchange.v2.resourcepool.CannotAcquireResourceException: A ResourcePool could not acquire a resource from its primary factory or source.

at com.mchange.v2.resourcepool.BasicResourcePool.awaitAcquire(BasicResourcePool.java:970)

at com.mchange.v2.resourcepool.BasicResourcePool.checkoutResource(BasicResourcePool.java:208)

at com.mchange.v2.c3p0.impl.C3P0PooledConnectionPool.checkoutPooledConnection(C3P0PooledConnectionPool.java:232)

... 18 more

SQLException information

Error msg: No suitable driver

SQLSTATE: 08001

Error code: 0

java.sql.SQLException: No suitable driver

at java.sql.DriverManager.getConnection(DriverManager.java:545)

at java.sql.DriverManager.getConnection(DriverManager.java:171)

at com.ibm.tmds.model.jdbc.helper.DatabaseConnectionFastrac.getConnection(DatabaseConnectionFastrac.java:73)

at com.ibm.tmds.model.jdbc.helper.JDBCSearchDB.<init>(JDBCSearchDB.java:27)

at com.ibm.tmds.model.user.User.<init>(User.java:342)

at com.ibm.tmds.model.user.UserDAO.<init>(UserDAO.java:29)

at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)

at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:39)

at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:27)

at java.lang.reflect.Constructor.newInstance(Constructor.java:494)

at org.hibernate.engine.UnsavedValueFactory.instantiate(UnsavedValueFactory.java:22)

at org.hibernate.engine.UnsavedValueFactory.getUnsavedIdentifierValue(UnsavedValueFactory.java:44)

at org.hibernate.tuple.PropertyFactory.buildIdentifierProperty(PropertyFactory.java:44)

at org.hibernate.tuple.entity.EntityMetamodel.<init>(EntityMetamodel.java:118)

at org.hibernate.persister.entity.AbstractEntityPersister.<init>(AbstractEntityPersister.java:425)

at org.hibernate.persister.entity.SingleTableEntityPersister.<init>(SingleTableEntityPersister.java:109)

at org.hibernate.persister.PersisterFactory.createClassPersister(PersisterFactory.java:55)

at org.hibernate.impl.SessionFactoryImpl.<init>(SessionFactoryImpl.java:226)

at org.hibernate.cfg.Configuration.buildSessionFactory(Configuration.java:1291)

at com.ibm.tmds.model.persistence.PersistenceEnvBaseImpl.createSessionFactory(PersistenceEnvBaseImpl.java:90)

at com.ibm.tmds.model.persistence.PersistenceEnvBaseImpl.<init>(PersistenceEnvBaseImpl.java:43)

at com.ibm.tmds.model.persistence.PersistenceEnvBaseImpl.getInstance(PersistenceEnvBaseImpl.java:53)

at com.ibm.tmds.model.persistence.PersistenceAdapterForHibernate.startPersistenceEnvironment(PersistenceAdapterForHibernate.java:51)

at com.ibm.tmds.model.persistence.PersistenceAdapterForHibernate.<clinit>(PersistenceAdapterForHibernate.java:43)

at com.ibm.tmds.view.util.TMDSStart$1.run(TMDSStart.java:600)

at java.awt.event.InvocationEvent.dispatch(InvocationEvent.java:209)

at java.awt.EventQueue.dispatchEvent(EventQueue.java:461)

at java.awt.EventDispatchThread.pumpOneEventForHierarchy(EventDispatchThread.java:242)

at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:163)

at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:157)

at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:149)

at java.awt.EventDispatchThread.run(EventDispatchThread.java:110)




then i changed the driver to : com.ibm.db2.jcc.DB2Driver in my config file:
and now i get an OutOfMemoryError. which i am working on..
Can i assume that since its not giving me driver exception, my current driver is fine.

we had an application with OJB which we are now converting to hibernate.
I also want to know that is it possible to have hibernate along with the normal jdbc connection as because of some performance issue some part of the application was changed to normal jdbc routine and some of the database quries are handled through that.


here is my config file:

<?xml version='1.0' encoding='utf-8' ?>
<!DOCTYPE hibernate-configuration PUBLIC
"-//Hibernate/Hibernate Configuration DTD 3.0//EN"
"http://hibernate.sourceforge.net/hibernate-configuration-3.0.dtd">
<hibernate-configuration>
<session-factory>
<!-- database connection settings -->
<property name="connection.driver_class">
com.ibm.db2.jcc.DB2Driver
</property>
<property name="connection.url">
jdbc b2://rivaldo:50000/COAPP
</property>
<property name="connection.username">admindb</property>
<property name="connection.password">admindb</property>
<!-- end database connection settings -->

<!-- jdbc connection pool - use the built-in one -->
<!--<property name="connection.pool_size">1</property>-->
<property name="hibernate.c3p0.min_size">5</property>
<property name="hibernate.c3p0.max_size">20</property>
<property name="hibernate.c3p0.timeout">1800</property>
<property name="hibernate.c3p0.max_statements">50</property>

<!-- SQL Dialect -->
<property name="dialect">
org.hibernate.dialect.DB2Dialect
</property>

<!-- enable hibernate's automatic session context management -->
<property name="current_session_context_class">thread</property>

<!-- disable the second level cache -->
<property name="cache.provider_class">
org.hibernate.cache.NoCacheProvider
</property>

<!-- Echo all the executed sql to stdout -->
<property name="show_sql">true</property>
<property name="use_sql_comments">true</property>

<!-- Other configuration parameters -->
<property name="max_fetch_depth">3</property>
<property name="order_updates">true</property>

<!-- mapping resources -->
<mapping resource="hibtable.hbm.xml" />
</session-factory>
</hibernate-configuration>

any help would be much appreciated.

thanks in advance..
Paul Sturrock
Bartender

Joined: Apr 14, 2004
Posts: 10336

"Mahima"

Welcome to JavaRanch! Please can you change your display name to comply with our Naming Policy? You can do this here.

Thanks!


JavaRanch FAQ HowToAskQuestionsOnJavaRanch
Mahima Singh
Greenhorn

Joined: May 16, 2007
Posts: 26
Hi! again..

well i found out that for hibernate we need type 4 driver which is com.ibm.db2.jcc.DB2Driver. so i think i am using the right driver now..
but i am still battling with OutOfMemoryError.

Apprently whats happening is in my createSessionFactory:

private void createSessionFactory() {
if(sessionFactory == null) {
try {

1 Configuration cfg = new Configuration();

2 cfg.configure();

3 System.out.println(cfg.getProperties());

4 sessionFactory = cfg.buildSessionFactory();

5 System.out.println(�sessionFactory created�);

}...



when I stdout configuration properties I can see all required jar in the classpath .. & aparently it gets connected to database. after that when it comes to cfg.buildSessionFactory() ..

it goes to another class : DatabaseConnection- getConnection()

public static java.sql.Connection getConnection() {

try {

if (connection == null) {

//Class.forName("COM.ibm.db2.jdbc.app.DB2Driver");

Class.forName("com.ibm.db2.jcc.DB2Driver");

connection = java.sql.DriverManager.getConnection("jdbc b2:" + dbConnectionUrl, dbUsername, dbPasswd);
connection.setAutoCommit(false);

} catch (ClassNotFoundException e) {

JOptionPane.showMessageDialog(null, "Could not load JDBC driver", "Warning", JOptionPane.ERROR_MESSAGE);

} catch (SQLException ex) {

System.err.println("SQLException information" + ex.getMessage());

}

return connection;
}

As i mentioned, there is some portion of application which still uses the basic JDBC connection.

then it goes to UserDAO() constructors & after that it gives an OutOfMemoryError. but a sessionFactory never gets created as code never comes back to line: 5 of previous code..


please, please help...
Jaikiran Pai
Marshal

Joined: Jul 20, 2005
Posts: 10202
    
166

Post the exception stacktrace that you are seeing. That might help us in pointing you in the right direction


[My Blog] [JavaRanch Journal]
Mahima Singh
Greenhorn

Joined: May 16, 2007
Posts: 26
thankz for reply,

i don't see any exception stacktrace, thats it the problem..

what i get on console from above code is :

{java.vendor=Sun Microsystems Inc., show_sql=true, hibernate.connection.url=jdbc b2://hades:50000/FASTRAC, sun.management.compiler=HotSpot Client Compiler, use_sql_comments=true, os.name=Windows 2003, sun.boot.class.path=C:\JBuilder2007\jre\jre\lib\rt.jar;C:\JBuilder2007\jre\jre\lib\i18n.jar;C:\JBuilder2007\jre\jre\lib\sunrsasign.jar;C:\JBuilder2007\jre\jre\lib\jsse.jar;C:\JBuilder2007\jre\jre\lib\jce.jar;C:\JBuilder2007\jre\jre\lib\charsets.jar;C:\JBuilder2007\jre\jre\classes, hibernate.current_session_context_class=thread, sun.desktop=windows, hibernate.c3p0.max_size=20, java.vm.specification.vendor=Sun Microsystems Inc., java.runtime.version=1.5.0_09-b03, hibernate.c3p0.min_size=5, hibernate.cache.provider_class=org.hibernate.cache.NoCacheProvider, user.name=fastracd, connection.driver_class=com.ibm.db2.jcc.DB2Driver, current_session_context_class=thread, hibernate.c3p0.timeout=1800, user.language=en, sun.boot.library.path=C:\JBuilder2007\jre\jre\bin, dialect=org.hibernate.dialect.DB2Dialect, max_fetch_depth=3, java.version=1.5.0_09, user.timezone=GMT+02:00, sun.arch.data.model=32, java.endorsed.dirs=C:\JBuilder2007\jre\jre\lib\endorsed, sun.cpu.isalist=, sun.jnu.encoding=Cp1252, file.encoding.pkg=sun.io, file.separator=\, java.specification.name=Java Platform API Specification, java.class.version=49.0, user.country=ZA, connection.url=jdbc b2://hades:50000/FASTRAC, java.home=C:\JBuilder2007\jre\jre, java.vm.info=mixed mode, os.version=5.2, path.separator=;, connection.password=db2admin, java.vm.version=1.5.0_09-b03, hibernate.max_fetch_depth=3, hibernate.connection.password=db2admin, user.variant=, java.awt.printerjob=sun.awt.windows.WPrinterJob, hibernate.order_updates=true, order_updates=true, sun.io.unicode.encoding=UnicodeLittle, awt.toolkit=sun.awt.windows.WToolkit, hibernate.connection.username=db2admin, user.home=C:\Documents and Settings\fastracd, java.specification.vendor=Sun Microsystems Inc., java.library.path=C:\JBuilder2007\jre\bin;.;C:\WINDOWS\system32;C:\WINDOWS;C:\WINDOWS\system32;C:\WINDOWS;C:\WINDOWS\system32\WBEM;C:\Borland\CaliberRMServer\Bin;C:\Borland\CaliberRMServer\Versant\6_0_5\NT\Bin;C:\Borland\CaliberRMServer\Lib;C:\Program Files (x86)\Java\jdk1.5.0_06\bin;C:\Program Files\ATI Technologies\ATI Control Panel;C:\Program Files\Intel\DMIX;C:\Program Files (x86)\Borland\StarTeam SDK 2005 R2\Lib;C:\Program Files (x86)\Borland\StarTeam SDK 2005 R2\Bin;C:\Program Files (x86)\Microsoft SQL Server\80\Tools\Binn\;C:\PROGRA~1\IBM\SQLLIB\BIN;C:\PROGRA~1\IBM\SQLLIB\FUNCTION;C:\PROGRA~1\IBM\SQLLIB\SAMPLES\REPL;C:\PROGRA~2\IBM\SQLLIB\BIN;C:\PROGRA~2\IBM\SQLLIB\FUNCTION;C:\PROGRA~2\IBM\SQLLIB\SAMPLES\REPL;C:\Program Files (x86)\Apache Group\Tomcat 4.1\webapps\fastrac\fastracjarfile\fastracapp.jar;C:\Program Files (x86)\Borland\CaliberRM SDK 2005 R2\lib;C:\Bridge2Java\runtime\bridge2java\Release;, java.vendor.url=http://java.sun.com/, hibernate.connection.driver_class=com.ibm.db2.jcc.DB2Driver, connection.username=db2admin, java.vm.vendor=Sun Microsystems Inc., hibernate.dialect=org.hibernate.dialect.DB2Dialect, java.runtime.name=Java(TM) 2 Runtime Environment, Standard Edition, java.class.path=C:\JBuilder2007\workspace\Fastrac;C:\JBuilder2007\workspace\Fastrac\External_Jars\tools.jar;C:\JBuilder2007\workspace\Fastrac\External_Jars\decimal.jar;C:\JBuilder2007\workspace\Fastrac\External_Jars\eel.jar;C:\JBuilder2007\workspace\Fastrac\External_Jars\tsik.jar;C:\JBuilder2007\workspace\Fastrac\External_Jars\xpp3-1.1.3.4d_b4_min.jar;C:\JBuilder2007\workspace\Fastrac\External_Jars\xstream-1.0.jar;C:\JBuilder2007\workspace\Fastrac\External_Jars\ProActive.jar;C:\JBuilder2007\work space\Fastrac\External_Jars\asm.jar;C:\JBuilder2007\workspace\Fastrac\External_Jars\log4j-1.2.8.jar;C:\JBuilder2007\workspace\Fastrac\External_Jars\xercesImpl-2.7.1.jar;C:\JBuilder2007\workspace\Fastrac\External_Jars\fractal.jar;C:\JBuilder2007\workspace\Fastrac\External_Jars\bouncycastle.jar;C:\JBuilder2007\workspace\Fastrac\External_Jars\avalon-framework-cvs-20020806.jar;C:\JBuilder2007\workspace\Fastrac\External_Jars\breezetk.jar;C:\JBuilder2007\workspace\Fastrac\External_Jars\jintegra.jar;C: \JBuilder2007\workspace\Fastrac\External_Jars\looks-2.1.0.jar;C:\JBuilder2007\workspace\Fastrac\External_Jars\looks-1.2.0.jar;C:\JBuilder2007\workspace\Fastrac\External_Jars\looks-win-1.2.0.jar;C:\JBuilder2007\workspace\Fastrac\External_Jars\plastic-1.2.0.jar;C:\JBuilder2007\workspace\Fastrac\External_Jars\xml-apis.jar;C:\JBuilder2007\workspace\Fastrac\External_Jars\xerces-2.6.2.jar;C:\JBuilder2007\workspace\Fastrac\External_Jars\versioncheck.jar;C:\JBuilder2007\workspace\Fastrac\External_Jars\s yndiag2.jar;C:\JBuilder2007\workspace\Fastrac\External_Jars\swarmcache-1.0rc2.jar;C:\JBuilder2007\workspace\Fastrac\External_Jars\proxool-0.8.3.jar;C:\JBuilder2007\workspace\Fastrac\External_Jars\oscache-2.1.jar;C:\JBuilder2007\workspace\Fastrac\External_Jars\junit-3.8.1.jar;C:\JBuilder2007\workspace\Fastrac\External_Jars\jta.jar;C:\JBuilder2007\workspace\Fastrac\External_Jars\jgroups-2.2.8.jar;C:\JBuilder2007\workspace\Fastrac\External_Jars\jdbc2_0-stdext.jar;C:\JBuilder2007\workspace\Fastrac\E xternal_Jars\jaxen-1.1-beta-7.jar;C:\JBuilder2007\workspace\Fastrac\External_Jars\javassist.jar;C:\JBuilder2007\workspace\Fastrac\External_Jars\jacc-1_0-fr.jar;C:\JBuilder2007\workspace\Fastrac\External_Jars\jaas.jar;C:\JBuilder2007\workspace\Fastrac\External_Jars\hibernate3.jar;C:\JBuilder2007\workspace\Fastrac\External_Jars\ehcache-1.2.3.jar;C:\JBuilder2007\workspace\Fastrac\External_Jars\dom4j-1.6.1.jar;C:\JBuilder2007\workspace\Fastrac\External_Jars\connector.jar;C:\JBuilder2007\workspace\Fa strac\External_Jars\concurrent-1.3.2.jar;C:\JBuilder2007\workspace\Fastrac\External_Jars\commons-logging-1.0.4.jar;C:\JBuilder2007\workspace\Fastrac\External_Jars\commons-collections-2.1.1.jar;C:\JBuilder2007\workspace\Fastrac\External_Jars\cleanimports.jar;C:\JBuilder2007\workspace\Fastrac\External_Jars\checkstyle-all.jar;C:\JBuilder2007\workspace\Fastrac\External_Jars\cglib-2.1.3.jar;C:\JBuilder2007\workspace\Fastrac\External_Jars\c3p0-0.9.0.jar;C:\JBuilder2007\workspace\Fastrac\External_Jars\ asm-attrs.jar;C:\JBuilder2007\workspace\Fastrac\External_Jars\thirdparty.jar;C:\JBuilder2007\workspace\Fastrac\External_Jars\OJBThirdparty.jar;C:\JBuilder2007\workspace\Fastrac\External_Jars\db2jcc.jar;C:\JBuilder2007\workspace\Fastrac, hibernate.bytecode.use_reflection_optimizer=false, java.vm.specification.name=Java Virtual Machine Specification, java.vm.specification.version=1.0, sun.cpu.endian=little, sun.os.patch.level=Service Pack 1, java.io.tmpdir=C:\DOCUME~1\fastracd\LOCALS~1\Temp\, java.vendor.url.bug=http://java.sun.com/cgi-bin/bugreport.cgi, os.arch=x86, java.awt.graphicsenv=sun.awt.Win32GraphicsEnvironment, java.ext.dirs=C:\JBuilder2007\jre\jre\lib\ext, hibernate.use_sql_comments=true, user.dir=C:\JBuilder2007\workspace\Fastrac, line.separator=
, java.vm.name=Java HotSpot(TM) Client VM, cache.provider_class=org.hibernate.cache.NoCacheProvider, file.encoding=Cp1252, java.specification.version=1.5, hibernate.show_sql=true, hibernate.c3p0.max_statements=50}

Exception in thread "AWT-EventQueue-0" java.lang.OutOfMemoryError: Java heap space


Paul Sturrock
Bartender

Joined: Apr 14, 2004
Posts: 10336

Have you tried giving your application more memory?
Mahima Singh
Greenhorn

Joined: May 16, 2007
Posts: 26
its a swing based application & i have 2GB RAM & DB doesn't run on my machine. here in the log entry..

10:17:18,988 INFO Environment:500 - Hibernate 3.2.1
10:17:19,003 INFO Environment:533 - hibernate.properties not found
10:17:19,003 INFO Environment:667 - Bytecode provider name : cglib
10:17:19,019 INFO Environment:584 - using JDK 1.4 java.sql.Timestamp handling
10:17:19,159 INFO Configuration:1423 - configuring from resource: /hibernate.cfg.xml
10:17:19,175 INFO Configuration:1400 - Configuration resource: /hibernate.cfg.xml
10:17:19,831 INFO Configuration:553 - Reading mappings from resource : tmds_edited.hbm.xml
10:17:21,144 INFO HbmBinder:300 - Mapping class: com.ibm.tmds.controller.bsp.BSPDiscrepencyDAO -> TMDS_BSPDISC
10:17:21,409 INFO HbmBinder:300 - Mapping class: com.ibm.tmds.controller.bsp.BSPLoadedFileDAO -> TMDS_BSPFILES
.
.
.
10:16:02,012 INFO HbmBinder:2375 - Mapping collection: com.ibm.tmds.model.document.RefundDAO.refundTaxes -> TMDS_REFUNDTAXES

10:16:02,137 INFO C3P0ConnectionProvider:50 - C3P0 using driver: com.ibm.db2.jcc.DB2Driver at URL: jdbc b2://hades:50000/FASTRAC
10:16:02,152 INFO C3P0ConnectionProvider:51 - Connection properties: {user=db2admin, password=****}
10:16:02,152 INFO C3P0ConnectionProvider:54 - autocommit mode: false
10:16:03,886 INFO SettingsFactory:81 - RDBMS: DB2/NT, version: SQL08024
10:16:03,886 INFO SettingsFactory:82 - JDBC driver: IBM DB2 JDBC Universal Driver Architecture, version: 1.1.67
10:16:03,933 INFO Dialect:151 - Using dialect: org.hibernate.dialect.DB2Dialect
10:16:03,964 INFO TransactionFactoryFactory:31 - Using default transaction strategy (direct JDBC transactions)
10:16:03,964 INFO TransactionManagerLookupFactory:33 - No TransactionManagerLookup configured (in JTA environment, use of read-write or transactional second-level cache is not recommended)
10:16:03,964 INFO SettingsFactory:134 - Automatic flush during beforeCompletion(): disabled
10:16:03,964 INFO SettingsFactory:138 - Automatic session close at end of transaction: disabled
10:16:03,964 INFO SettingsFactory:153 - Scrollable result sets: enabled
10:16:03,964 INFO SettingsFactory:161 - JDBC3 getGeneratedKeys(): disabled
10:16:03,964 INFO SettingsFactory:169 - Connection release mode: auto
10:16:03,964 INFO SettingsFactory:193 - Maximum outer join fetch depth: 3
10:16:03,980 INFO SettingsFactory:196 - Default batch fetch size: 1
10:16:03,996 INFO SettingsFactory:200 - Generate SQL with comments: enabled
10:16:03,996 INFO SettingsFactory:204 - Order SQL updates by primary key: enabled
10:16:03,996 INFO SettingsFactory:369 - Query translator: org.hibernate.hql.ast.ASTQueryTranslatorFactory
10:16:04,011 INFO ASTQueryTranslatorFactory:24 - Using ASTQueryTranslatorFactory
10:16:04,011 INFO SettingsFactory:212 - Query language substitutions: {}
10:16:04,011 INFO SettingsFactory:217 - JPA-QL strict compliance: disabled
10:16:04,011 INFO SettingsFactory:222 - Second-level cache: enabled
10:16:04,011 INFO SettingsFactory:226 - Query cache: disabled
10:16:04,027 INFO SettingsFactory:356 - Cache provider: org.hibernate.cache.NoCacheProvider
10:16:04,027 INFO SettingsFactory:241 - Optimize cache for minimal puts: disabled
10:16:04,027 INFO SettingsFactory:250 - Structured second-level cache entries: disabled
10:16:04,043 INFO SettingsFactory:270 - Echoing all SQL to stdout
10:16:04,043 INFO SettingsFactory:277 - Statistics: disabled
10:16:04,043 INFO SettingsFactory:281 - Deleted entity synthetic identifier rollback: disabled
10:16:04,043 INFO SettingsFactory:296 - Default entity-mode: pojo
10:16:04,168 INFO SessionFactoryImpl:161 - building session factory

Exception in thread "AWT-EventQueue-0" java.lang.OutOfMemoryError: Java heap space

it is unable to build SessionFactory. Is everything with my settings fine?
Paul Sturrock
Bartender

Joined: Apr 14, 2004
Posts: 10336


its a swing based application & i have 2GB RAM & DB doesn't run on my machine.

...and how much of that memory have you given to your application? Remember that a JVM needs to have its heap size defined up front. By default I think the heap size of the Sun JVM is around 2Mb. Try setting it higher.
Mahima Singh
Greenhorn

Joined: May 16, 2007
Posts: 26
heap size : 508M max
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Hibernate DB2