ronysebastian / nhin-d

Automatically exported from code.google.com/p/nhin-d
0 stars 0 forks source link

config-service doesn't work with postgres #158

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
config-service doesn't work with postgres.

DaoImpl classess should use transaction like the following:
EntityTransaction transaction = entityManager.getTransaction();
transaction.begin();
...
transaction.commit();

Exception:
--------------------------------------------------
Caused by: org.hibernate.exception.GenericJDBCException: could not execute query
        at org.hibernate.exception.SQLStateConverter.handledNonSpecificException(SQLStateConverter.java:103)
        at org.hibernate.exception.SQLStateConverter.convert(SQLStateConverter.java:91)
        at org.hibernate.exception.JDBCExceptionHelper.convert(JDBCExceptionHelper.java:43)
        at org.hibernate.loader.Loader.doList(Loader.java:2216)
        at org.hibernate.loader.Loader.listIgnoreQueryCache(Loader.java:2104)
        at org.hibernate.loader.Loader.list(Loader.java:2099)
        at org.hibernate.loader.hql.QueryLoader.list(QueryLoader.java:378)
        at org.hibernate.hql.ast.QueryTranslatorImpl.list(QueryTranslatorImpl.java:338)
        at org.hibernate.engine.query.HQLQueryPlan.performList(HQLQueryPlan.java:172)
        at org.hibernate.impl.SessionImpl.list(SessionImpl.java:1121)
        at org.hibernate.impl.QueryImpl.list(QueryImpl.java:79)
        at org.hibernate.ejb.QueryImpl.getResultList(QueryImpl.java:65)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
        at java.lang.reflect.Method.invoke(Method.java:597)
        at org.springframework.orm.jpa.SharedEntityManagerCreator$DeferredQueryInvocationHandler.invoke(SharedEntityManagerCreator.java:310)
        at $Proxy162.getResultList(Unknown Source)
        at org.nhindirect.config.store.dao.impl.AnchorDaoImpl.list(AnchorDaoImpl.java:137)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
        at java.lang.reflect.Method.invoke(Method.java:597)
        at org.springframework.aop.support.AopUtils.invokeJoinpointUsingReflection(AopUtils.java:309)
        at org.springframework.aop.framework.ReflectiveMethodInvocation.invokeJoinpoint(ReflectiveMethodInvocation.java:183)
        at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:150)
        at org.springframework.dao.support.PersistenceExceptionTranslationInterceptor.invoke(PersistenceExceptionTranslationInterceptor.java:155)
        ... 41 more
Caused by: org.postgresql.util.PSQLException: Large Objects may not be used in 
auto-commit mode.
        at org.postgresql.largeobject.LargeObjectManager.open(LargeObjectManager.java:200)
        at org.postgresql.largeobject.LargeObjectManager.open(LargeObjectManager.java:172)
        at org.postgresql.jdbc2.AbstractJdbc2BlobClob.<init>(AbstractJdbc2BlobClob.java:47)
        at org.postgresql.jdbc2.AbstractJdbc2Blob.<init>(AbstractJdbc2Blob.java:21)
        at org.postgresql.jdbc3.AbstractJdbc3Blob.<init>(AbstractJdbc3Blob.java:19)
        at org.postgresql.jdbc4.AbstractJdbc4Blob.<init>(AbstractJdbc4Blob.java:20)
        at org.postgresql.jdbc4.Jdbc4Blob.<init>(Jdbc4Blob.java:20)
        at org.postgresql.jdbc4.Jdbc4ResultSet.getBlob(Jdbc4ResultSet.java:52)
        at org.postgresql.jdbc2.AbstractJdbc2ResultSet.getBlob(AbstractJdbc2ResultSet.java:335)
        at org.apache.commons.dbcp.DelegatingResultSet.getBlob(DelegatingResultSet.java:565)
        at org.apache.commons.dbcp.DelegatingResultSet.getBlob(DelegatingResultSet.java:565)
        at org.hibernate.type.ByteArrayBlobType.get(ByteArrayBlobType.java:87)
        at org.hibernate.type.AbstractLobType.nullSafeGet(AbstractLobType.java:46)
        at org.hibernate.type.AbstractType.hydrate(AbstractType.java:81)
        at org.hibernate.persister.entity.AbstractEntityPersister.hydrate(AbstractEntityPersister.java:2101)
        at org.hibernate.loader.Loader.loadFromResultSet(Loader.java:1380)
        at org.hibernate.loader.Loader.instanceNotYetLoaded(Loader.java:1308)
        at org.hibernate.loader.Loader.getRow(Loader.java:1206)
        at org.hibernate.loader.Loader.getRowFromResultSet(Loader.java:580)
        at org.hibernate.loader.Loader.doQuery(Loader.java:701)
        at org.hibernate.loader.Loader.doQueryAndInitializeNonLazyCollections(Loader.java:236)
        at org.hibernate.loader.Loader.doList(Loader.java:2213)
        ... 64 more

Original issue reported on code.google.com by teru.mor...@gmail.com on 22 Jul 2011 at 2:39

GoogleCodeExporter commented 9 years ago
Could you please provide your entityManagerFactory and dataSource XML 
configuration in the beans.xml file?

thx

Original comment by gm2...@cerner.com on 1 Aug 2011 at 12:25

GoogleCodeExporter commented 9 years ago
Pat will look into this.

Original comment by gm2...@cerner.com on 8 Sep 2011 at 7:25

GoogleCodeExporter commented 9 years ago

Original comment by ppyette@gmail.com on 8 Sep 2011 at 7:27

GoogleCodeExporter commented 9 years ago
This issue was closed by revision fb8774cacc45.

Original comment by ppyette@gmail.com on 20 Oct 2011 at 8:47