Monday, September 26, 2005

 

Upgrading from Hibernate2 -> Hibernate3

I decided to upgrade to hibernate3 because of many reasons. One of the reasons was that Hibernate3 offers a cleaner API with less redundencies. Hibernate3 also supports delete and update support via Query interface.

1) Change packages in your source code as follows:
net.sf.hibernate -> org.hibernate
net.sf.hibernate.expression -> org.hibernate.criterion

2) If you have any log4j configuration file (typically this file is called log4j.properties and resides in the classes directory) has entries for the package net.sf.hibernate, change it to org.hibernate.

Monday, September 19, 2005

 

Postgresql transaction error

I am getting this server side error:

Caused by: org.postgresql.util.PSQLException: ERROR: current transaction is aborted, commands ignored until end of transaction block

at org.postgresql.util.PSQLException.parseServerError(PSQLException.java:139)
at org.postgresql.core.QueryExecutor.executeV3(QueryExecutor.java:156)
at org.postgresql.core.QueryExecutor.execute(QueryExecutor.java:101)
at org.postgresql.core.QueryExecutor.execute(QueryExecutor.java:43)
at org.postgresql.jdbc1.AbstractJdbc1Statement.execute(AbstractJdbc1Statement.java:517)
at org.postgresql.jdbc2.AbstractJdbc2Statement.execute(AbstractJdbc2Statement.java:50)
at org.postgresql.jdbc1.AbstractJdbc1Statement.executeQuery(AbstractJdbc1Statement.java:233)
at net.sf.hibernate.impl.BatcherImpl.getResultSet(BatcherImpl.java:87)
at net.sf.hibernate.loader.Loader.getResultSet(Loader.java:875)
at net.sf.hibernate.loader.Loader.doQuery(Loader.java:269)
at net.sf.hibernate.loader.Loader.doQueryAndInitializeNonLazyCollections(Loader.java:133)
at net.sf.hibernate.loader.Loader.loadEntity(Loader.java:911)
at net.sf.hibernate.loader.Loader.loadEntity(Loader.java:931)
at net.sf.hibernate.loader.EntityLoader.load(EntityLoader.java:59)
at net.sf.hibernate.loader.EntityLoader.load(EntityLoader.java:51)
at net.sf.hibernate.persister.EntityPersister.load(EntityPersister.java:419)
... 47 more

This page is powered by Blogger. Isn't yours?