We have an 2 tier application with Swing and Hibernate (3.3.2.GA) on the client side and MySql on the servers side.
The application shows all objects (class network) in a tree component. To work with an network object the user selects the tree node.
To reflect changes by other useres we use "getSession().refresh(obj);" when the object was selected in the GUI.
Refreshing objects of the class network doesn’t work.
Code:
<class
name=".."
table="network"
>
...
<!-- bi-directional one-to-many association to IpAddress -->
<set
name="ipAddresses"
lazy="true"
inverse="true"
cascade="all"
>
...
</class>
<class
name="..."
table="ip_address"
>
...
<many-to-one
name="network"
class="de.unikoeln.rrz.uklanadmin.model.entities.Network"
not-null="true"
lazy="false"
>
...
</class>
I think the problem is the outer join generatet by hibernate: select network0_.net_id ... outer join ip_address ipaddresse1_ on network0_.net_id=ipaddresse1_.net_id where network0_.net_id=?
The persister returns the first element of the resultset containig the changes in the database but dosent refresh the object.
Object result = persister.load( id, object, event.getLockMode(), source );
How can we ensure to refresh our network objects?
Thx, Michael