Hibernate version:
3.0.5
Name and version of the database you are using:
MySQL 4.1.14
At the beginning and end of each JSP page in my application, I open and close the Hibernate session using the HibernateUtil class from the book with ThreadLocals.
Everything works except lists on the join table of a many to many relationship. I have another m-n join table which does work, but the broken one, AonB, alos contains extraInformation. The mapping files are set up so that As have a many to many to Bs and vice versa AND both As and Bs each have a one to many relation to As on Bs.
When fetching a list using
Code:
createQuery("from AonB").list();// OR
createQuery("from AonB where aid=:aid").setString("aid", getAID()).list();
a list of the correct size (I can check the DB with mySQL Query Browser, so I know DB is correct) is returned but the list contains duplicates and hence not all the correct lines....?!
Any help greatly appreciated