I have posted the related codes in the fisrt post of this topic...
I seems the Many to Many relation(lazy by default) caused the problem.
Yeah @ManyToMany will be fetch lazy by default and proxied untill you need it. The LazyInitializationException means the entity is detached from entitymanager.
Seems like there are several possible solutions:
this.currentAddressee = em.find("from " + Addressee.class.getName() + " fetch all properties where id = :0").setParameter(0, this.addresseeId)...
If you use Seam Managed Persistence and the conversation is properly set then it seems like a bug. The entity shouldn't be detached, or am I wrong?
I think this is a bug... the code was migrated from the before seam2 application.
I used some pages like this in before Seam 2 applications, I had not encountered such problems.
I filed a bug about this...
Hantsy, you're using it wrong.
You're already inside of a Stateful Session bean, which wraps all of the method calls on that bean inside of a transaction. Because you're also using Seam Faces, it also wraps the request in a transaction. Then yet again, you're save method is starting a transaction. It's no wonder you're having problems with transactions already being active. This would have been a problem in Seam 2 as well. Pick a strategy and stick with it, and only that one, you'll save yourself many headaches such as this one.
Also, when you say you created a bug, please post a link to the bug you created so others can follow it.
By default, the transaction should use REQUIRED propagation , it will use the existed transaction or create a new one(if it is not existed), right ?
So, I do not think if transaction is added or not caused the problem.
Yes, I filed a bug about this.
Now I am working on a large Seam 2 project over one year, I never encountered such problems.
Some of these codes are migrated from the Seam 2 project, the logic of the code is not change, only changed the api.
The problem here is there is no active session found in the Conversation scope, it is so strange?
The seam managed persistence should make the entity manager active in the whole conversation scope, some like using EntityManagerType.EXTENDED in a stateful session bean...
But obviously, I used Seam managed persistence, but it did not provide such a feature.
I had added the link in the
OK, I added another link in the comments.
There is no requirement I must use @Stateful session bean, I only wanted to try the EJB 3.1 none interface bean, there is no difference from POJO in programming view. I know it will be managed by the EJB container at runtime.
I think we miss understood. If you add a jira issue you should post the link in the depending forum thread (like I did for you).
The forum reference in the jira issue is fine. Everything is ok. :)
Due the f2f meeting in Toronto this week, I should expect much response this week.
Sorry I mean:
I wouldn't expect much response this week
Oh, I understand now.
I have tried ur propsals,
1. use pojo instead of EJB
2. remove @Transactional
And the same exception in the saved method