openjpa-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Sergey Elin" <eli...@gmail.com>
Subject OpenJPA 0.9.7 and empbedded websphere MSSQL driver: bug?
Date Thu, 13 Sep 2007 10:26:42 GMT
Hi,

then i try to call store procedure with null values via embedded websphere
jdbc driver on SQLServer I get an exception.

[IBM][SQLServer JDBC Driver]Unable to determine the type of the specified
object.

Here is the code:

Query q=JpaManager.getEntityManager().createNativeQuery(
"Execute spTree_getSpecs_v2 @p_PARTY_ID=?1," +
" @p_GRANT=?2, @p_GROUP_ID=?3, @p_BRAND_ID=?4, @p_VENDOR_ID=?5, " +
"@p_ORDER=?6, @p_BEGIN=?7, @p_END=?8", "ItemPaging");

q.setParameter(1, party_id);
q.setParameter(2, permission);
q.setParameter(3, group_id);
q.setParameter(4, brand_id);
q.setParameter(5, vendor_id);
q.setParameter(6, order);
q.setParameter(7, begin);
q.setParameter(8, end);
q.getResultList();

stack trace:

Caused by: <0.0.0 nonfatal general error>
org.apache.openjpa.persistence.PersistenceException: [IBM][SQLServer JDBC
Driver]Unable to determine the type of the specified object.
at org.apache.openjpa.jdbc.sql.DBDictionary.newStoreException(
DBDictionary.java:3786)
at org.apache.openjpa.jdbc.sql.SQLExceptions.getStore(SQLExceptions.java:97)
at org.apache.openjpa.jdbc.sql.SQLExceptions.getStore(SQLExceptions.java:83)
at org.apache.openjpa.jdbc.sql.SQLExceptions.getStore(SQLExceptions.java:59)
at org.apache.openjpa.jdbc.kernel.SQLStoreQuery$SQLExecutor.executeQuery (
SQLStoreQuery.java:301)
at org.apache.openjpa.kernel.QueryImpl.execute(QueryImpl.java:985)
at org.apache.openjpa.kernel.QueryImpl.execute(QueryImpl.java:796)
at org.apache.openjpa.kernel.QueryImpl.execute(QueryImpl.java :766)
at org.apache.openjpa.kernel.DelegatingQuery.execute(DelegatingQuery.java
:533)
at org.apache.openjpa.persistence.QueryImpl.execute(QueryImpl.java:227)
at org.apache.openjpa.persistence.QueryImpl.getResultList (QueryImpl.java
:269)
at ru.topsbi.teko.beans.ui.news.NewsDetailsItemsBean.fetchNews(
NewsDetailsItemsBean.java:134)
at ru.topsbi.teko.beans.ui.news.NewsDetailsItemsBean.getNews(
NewsDetailsItemsBean.java:212)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java
:64)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(
DelegatingMethodAccessorImpl.java :43)
at java.lang.reflect.Method.invoke(Method.java:615)
at com.sun.faces.el.PropertyResolverImpl.getValue(PropertyResolverImpl.java
:79)
... 55 more

The problem is then I call stored procedure with null, then null's type
treated as javax.sql.Types.OTHER. Then it passes to websphere's embedded
driver and it throws an exception because it doesn't know what to do with
it. If I change value's type to java.sql.Types.NUMERIC in runtime (in debug
mode) then everything works.

I don't actually know is this a bug or a feature and don't know where to
report it. =(

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message