[hibernate-issues] [Hibernate-JIRA] Commented: (HHH-2962) ResultCheckStyle.PARAM does not work with PostgreSQL

Julius Stroffek (JIRA) noreply at atlassian.com
Thu Dec 6 11:03:56 EST 2007


    [ http://opensource.atlassian.com/projects/hibernate/browse/HHH-2962?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_29080 ] 

Julius Stroffek commented on HHH-2962:
--------------------------------------

Hi Gail,

thanks for the suggestion, I'll create a test. I had a look at those tests and it seems to me that the issue can not be tested in CustomStoredProcTestSupport since the bug is not in a Hibernate support for stored procedures but in ResultCheckStyle.PARAM code.

The test would be more suitable to be present in ResultCheckStyleTest. I was wondering while this issue was not caught by the test since it already contains a bunch of tests. But the tests present there are testing only the negative response of ResultCheckStyle for the queries and also no check whether the exception thrown is the one expected. Positive response is not handled by any of these tests. 

> ResultCheckStyle.PARAM does not work with PostgreSQL
> ----------------------------------------------------
>
>                 Key: HHH-2962
>                 URL: http://opensource.atlassian.com/projects/hibernate/browse/HHH-2962
>             Project: Hibernate3
>          Issue Type: Bug
>          Components: core
>    Affects Versions: 3.2.5, 3.2.6, 3.3, 3.4
>         Environment: Hibernate 3.2.5, PostgreSQL 8.2 & 8.3beta
>            Reporter: Julius Stroffek
>         Attachments: hibernate.diff
>
>   Original Estimate: 5 minutes
>  Remaining Estimate: 5 minutes
>
> I have created a simple test application which uses a stored procedure
> to insert a record into a database using hibernate. I used hibernate
> annotations and have overridden insert statement by
> @SQLInsert(callable=true, sql="{? = call insert_party(?, ?, ?, ?)}", 
> check=ResultCheckStyle.PARAM)
> However, hibernate throws the exception
> ...
> Caused by: org.hibernate.exception.GenericJDBCException: could not extract row counts from CallableStatement
> at org.hibernate.jdbc.Expectations$BasicParamExpectation.determineRowCount(Expectations.java:123)
>        at org.hibernate.jdbc.Expectations$BasicExpectation.verifyOutcome(Expectations.java:41)
>        at org.hibernate.persister.entity.AbstractEntityPersister.insert(AbstractEntityPersister.java:2251)
>        at org.hibernate.persister.entity.AbstractEntityPersister.insert(AbstractEntityPersister.java:2661)
>        at org.hibernate.action.EntityInsertAction.execute(EntityInsertAction.java:56)
>        at org.hibernate.engine.ActionQueue.execute(ActionQueue.java:250)
>        at org.hibernate.engine.ActionQueue.executeActions(ActionQueue.java:234)
>        at org.hibernate.engine.ActionQueue.executeActions(ActionQueue.java:141)
>        at org.hibernate.event.def.AbstractFlushingEventListener.performExecutions(AbstractFlushingEventListener.java:298)
>        at org.hibernate.event.def.DefaultFlushEventListener.onFlush(DefaultFlushEventListener.java:27)
>        at org.hibernate.impl.SessionImpl.flush(SessionImpl.java:1000)
>        at org.hibernate.impl.SessionImpl.managedFlush(SessionImpl.java:338)
>        at org.hibernate.ejb.AbstractEntityManagerImpl$1.beforeCompletion(AbstractEntityManagerImpl.java:516)
>        ... 50 more
> Caused by: org.postgresql.util.PSQLException: Parameter of type java.sql.Types=2 was registered, but call to getInt (sqltype=java.sql.Types=4) was made.
>        at org.postgresql.jdbc2.AbstractJdbc2Statement.checkIndex(AbstractJdbc2Statement.java:2387)
>        at org.postgresql.jdbc2.AbstractJdbc2Statement.getInt(AbstractJdbc2Statement.java:1920)
>        at org.hibernate.jdbc.Expectations$BasicParamExpectation.determineRowCount(Expectations.java:119)
>        ... 62 more

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://opensource.atlassian.com/projects/hibernate/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        



More information about the hibernate-issues mailing list