links for 2011-03-05

6 03 2011
  • There's an Entity Class "A". Class A might have children of the same type "A". Also "A" should hold it's parent if it is a child.
    Is this possible? If so how should I map the relations in the Entity class? ["A" has an id column.]

    public class A implements Serializable {
    @Id @GeneratedValue(strategy=GenerationType.AUTO)
    private Long id;
    @ManyToOne private A parent;
    private Collection<A> children;

    // Code…

    Here's a rough main() method that persists three such entities:

    public static void main(String[] args) {

    EntityManager em = … // from EntityManagerFactory, injection, etc.


    A parent = new A();
    A son = new A();
    A daughter = new A();

    parent.setChildren(Arrays.asList(son, daughter));



  • Hello, from time to time (that's the worst about this bug 😉 ) I'm getting an: org.jboss.seam.ConcurrentRequestTimeoutException: Concurrent call to conversation.

    After a long search ;), The bug was of course on our side. We were ending a conversation programatically, by calling Conversation.endBeforeRedirect(). However, there was no redirect, so the conversation lock wasn't released.

    I changed it to be Conversation.end() and then Conversation.leave(), which causes the conversation to end, release the lock and start a new one. And so far no exceptions 🙂

    Adam Warski