Hallo,
I'm using ms sql 2000 with the newest jdbc (sqljdbc.jar) for 2000 and 2005 databases and the Jboss 4.0.4RC1.
The programm uses the createNativeQuery() methode. If I profile the generated sql by ejb I get:
declare @P1 int
set @P1=0
exec sp_prepexec @P1 output, NULL, N'select id from mytable where id = -1'
select @P1
Returns in the SQL Query Analyzer):
ID DESC
----------- -----------
(0 row(s) affected)
-----------
123
(1 row(s) affected)
For the id = -1 there is no recordeset returned (checked in SQL Query Analyzer). But the method getResultList() returns one row.
I think the problem is the select @P1 statement. This select returns allways numbers greater 0, I think this number is NOT the count of resultsets.
Is this a bug in ejb/hibernate or what can I do?
Thanks
Ralf
I'm so sorry!!!!
I don't recognize, that ejb uses a different database connection.
All works fine!!!!
Ralf