| Author |
Getting same record in query.
|
pankaj semwal
Ranch Hand
Joined: Oct 07, 2008
Posts: 300
|
|
Hi List,
When i run the query in oracle prompt its show two different record.But when i try to get the records in the view page its show same records i.e
same rows more than one.
My HBM file:
My POJO Class is
I am calling like this
Pl help me where is the mistake.
|
 |
Waswani Naresh
Ranch Hand
Joined: May 01, 2008
Posts: 66
|
|
The number of records that you are getting from the Query execution via Hibernate and from console are same, the only difference is the values of the row ? Is that correct ?
I did not find definition of clear(); what is the role of this method in the finally block ?
Have you tried wrapping your query execution with in transaction limits ? I know it does not make much sense here because you are getting some records fetched, but please try that once.
Also, could you paste the outcome of the System.out.println statements and the one that you are getting from the console.
Regards,
Naresh Waswani
|
Naresh Waswani
|
 |
pankaj semwal
Ranch Hand
Joined: Oct 07, 2008
Posts: 300
|
|
Hi,
Records count is coming same.But rows value repeating.
Hibernate generate the sql like this:
And in sql console the output coming like this
But when i put
Its prints two value Setup and Setup in java console.It should print Setup and Barcode.
I used clear(); to clear the hibernate session.
|
 |
 |
|
|
subject: Getting same record in query.
|
|
|