[Persistence, JBoss/CMP, Hibernate, Database] - JPA question OneToMany, Cascading
by MarcusDidiusFalco
Hallo,
I want to use an entity which references a collection of other entities like
| @Entity
| public class Fencer implements Serializable {
|
| @OneToMany(cascade=CascadeType.ALL, fetch=FetchType.EAGER)
| @JoinColumn(name="fencer_id")
| public List<Tournament> getTournaments() {
| return tournaments;
| }
|
When I detach the fencer entity and change it in a remote client so that an entry from the list is removed and then merge it back with
entityManager.merge(fencer), the entity has the correct state, the deleted entry is gone. But on the DB level the deleted entry in the tournament table still exits. Only the foreign key is set to null.
This behavior is quite unexpected to me. If I do not remove the orphaned entries, the db will fill up with unneeded entries in the detail tables.
How do you implement this correctly to avoid this behavior?
Thanks,
Hans
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4091102#4091102
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4091102
18Â years, 6Â months
[Clustering/JBoss] - HA JNDI with no bind address
by fuzzybinary
Hi guys!
Is there a way to bind to all IP addresses on a machine without having the HA-JNDI system attempt to resolve a host name? When I run ./run.sh -c -b 0.0.0.0, it appears that it binds to the host name I've provided, but since I'm not running DNS on my local network, there's no way for JBoss to resolve that name into the propper IP address.
Here's an examples of what happens when I run the distributed-queue example from jboss.messaging with both queue's started (running the example on xerxies-jboss2.
| [java] 10:31:20,774 TRACE @main [HARMIClient] Init, clusterInfo: org.jboss.ha.framework.interfaces.FamilyClusterInfoImpl@2f549848{familyName=DefaultPartition/HAJNDI,targets=[HARMIServerImpl_Stub[UnicastRef2 [liveRef: [endpoint:[xerxies-jboss.linksys:1101](remote),objID:[79cc1654:11566454501:-7ffd, -5902891377782316408]]]]],currentViewId=1706865211,isViewMembersInSyncWithViewId=false,cursor=999999999,arbitraryObject=null}, policy=org.jboss.ha.framework.interfaces.RoundRobin@df503
| [java] 10:31:20,777 TRACE @main [HARMIClient] Invoking on target=HARMIServerImpl_Stub[UnicastRef2 [liveRef: [endpoint:[xerxies-jboss.linksys:1101](remote),objID:[79cc1654:11566454501:-7ffd, -5902891377782316408]]]]
| [java] 10:31:20,782 TRACE @main [HARMIClient] Invoke failed, target=HARMIServerImpl_Stub[UnicastRef2 [liveRef: [endpoint:[xerxies-jboss.linksys:1101](remote),objID:[79cc1654:11566454501:-7ffd, -5902891377782316408]]]]
| [java] java.rmi.UnknownHostException: Unknown host: xerxies-jboss.linksys; nested exception is:
| [java] java.net.UnknownHostException: xerxies-jboss.linksys
|
| etc...
|
Any ideas how to fix this? Is is possible to just run things without a bind address at all? (This is what I'd like, but all attempts to do it have failed).
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4091094#4091094
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4091094
18Â years, 6Â months