in my ejb i have such a construct...

        private long productsId;

        private List categories;

        @Id
        @GeneratedValue(strategy = GenerationType.AUTO)
        @Column(name = "products_id")
        public long getProductsId() {
                return productsId;
        }

        public void setProductsId(long productsId) {
                this.productsId = productsId;
        }

        @ManyToMany
        @JoinTable(name = "products_categories", joinColumns = @JoinColumn(name 
= "products_id", referencedColumnName = "products_id"), inverseJoinColumns = 
@JoinColumn(name = "categories_id", referencedColumnName = "categories_id"))
        public List getCategories() {
                return categories;
        }

        public void setCategories(List categories) {
                this.categories = categories;
        }

i get a list with content from db...

but if i want to access the list... :-(

Caused by: org.hibernate.LazyInitializationException: failed to lazily 
initialize a collection of role:... , no session or session was closed

what should i change...
        



View the original post : 
http://www.jboss.com/index.html?module=bb&op=viewtopic&p=3961720#3961720

Reply to the post : 
http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=3961720
_______________________________________________
jboss-user mailing list
jboss-user@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/jboss-user

Reply via email to