[jboss-jira] [JBoss JIRA] Commented: (HIBERNATE-43) SQL native Request who respond only the first letter

Stephen Friedrich (JIRA) jira-events at lists.jboss.org
Wed Feb 25 05:19:44 EST 2009


    [ https://jira.jboss.org/jira/browse/HIBERNATE-43?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12454170#action_12454170 ] 

Stephen Friedrich commented on HIBERNATE-43:
--------------------------------------------

More than two and a half years later and no reaction at all?!
We have just been bitten by the same bug (even with a simple query without "union").

> SQL native Request who respond only the first letter
> ----------------------------------------------------
>
>                 Key: HIBERNATE-43
>                 URL: https://jira.jboss.org/jira/browse/HIBERNATE-43
>             Project: Hibernate
>          Issue Type: Bug
>         Environment: Jboss 4.0.4 G.A. patch 1
>            Reporter: Alexandre PETRILLO
>            Assignee: Steve Ebersole
>
> I need to do some sql native query (to a data base Oracle 9i) from an EJB session Bean.
> I use Jboss in version 4.0.4 G.A. patch 1
> My simple code :
> public List doNativeQueryMultiple(String sqlQuery) {
> List list = manager.createNativeQuery(sqlQuery).getResultList();
> return list;
> }
> This is some exemple for understand the probleme.
> SELECT 'OUI' val FROM dual union SELECT 'NON' FROM dual Order BY 1 asc
> Response is : O,N
> SELECT 'TOTO' val FROM dual union SELECT 'NON' FROM dual Order BY 1 asc
> Response is : TOTO,NON
> SELECT 'TOT' val FROM dual union SELECT 'NON' FROM dual Order BY 1 asc
> Response is : T,N
> SELECT 'OUI' val FROM dual union SELECT 'abc' FROM dual Order BY 1 asc
> Response is : O,a
> SELECT 'OUI' val FROM dual union SELECT 'abcd' FROM dual Order BY 1 asc
> Response is : OUI,abcd
> SELECT 'OUI' val FROM dual union SELECT 'NON' FROM dual union SELECT 'TOT' FROM dual Order BY 1 asc
> Response is : O,N,T
> SELECT 'OUI' val FROM dual union SELECT 'NON' FROM dual union SELECT 'TOTO' FROM dual Order BY 1 asc
> Response is : OUI,NON,TOTO
> When the response of the request is correct, the return class type is java.lang.String
> And when is incorrect , the return class type is java.lang.Charactere, and the response contain the first letter.
> The bug is when the size of all of the selected string have the same length.
> The test done by Jboss for determine the class return type maybe is wrong.

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

        



More information about the jboss-jira mailing list