[EJB 3.0] - @PrePersist @PreUpdate within @AroundInvoke results in call-
by gnulp
I have a stateless sessionBean defined using an interceptor on a businessMethod as well as a entityBean with a listener.
| @Stateless
| @TransactionAttribute(TransactionAttributeType.REQUIRED)
| public class MyStatelessSessionBean {
| ...
| @Interceptors(MyInteceptor.class)
| public Object myPersistMethod(MyEntityObject myEntity) {
| ...
| // using an injected entityManager
| return entitymanger.merge(myEntity)
| ...
| }
| }
|
| public class MyInteceptor {
| @AroundInvoke
| public Object doInteception(InvocationContext context) throws Exception {
| try {
| System.out.println("before proceed");
| return context.proceed();
| } finally {
| System.out.println("after proceed");
| }
| }
|
| @Entity
| @EntityListeners(MyEntityListener.class)
| public class MyEntity {
| ...
| // some attributes / setters an getters ...
| ...
| }
|
| public class MyEntityListener {
| @PrePersist
| public void prePersit(Object entity) {
| System.out.println("prePersist entity");
| }
|
| @PreUpdate
| public void preUpdate(Object entity) {
| System.out.println("preUpdate entity");
| }
| }
|
|
calling the business-Method from a client twice with the same entity results in different call-stacks:
| ======= CREATING THE ENTITY with myEntity = service.myPersistMethod(myEntity) ==============
| INFO [STDOUT] before proceed
| INFO [STDOUT] prePersist entity
| INFO [STDOUT] after proceed
|
| ...
|
| ======= UPDATING THE ENTITY with myEntity = service.myPersistMethod(myEntity) ==============
| INFO [STDOUT] before proceed
| INFO [STDOUT] after proceed
| INFO [STDOUT] preUpdate entity
|
|
the first output is as expected, but the second isn't what I was expecting, because there is now way for the interceptor to get some information about possible updates within the entity-callbacks ...
Is this behaviour anywhere defined ? Can I assume any calling order in combination of Interceptors and callbackhandlers within a transaction - or is it explicitly undefined ...
Thx for any help ---
wbr
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=3989470#3989470
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=3989470
19Â years, 5Â months
[JBoss Seam] - Debug page intercepts handled exceptions in 1.1
by rbz285
I've just upgraded from 1.0.1.GA to 1.1.0.CR1
In my app I have a JSF page calling a stateful seam bean which then calls another stateless seam bean. The second bean can throw an exception which is caught and handled by the first, which then shows a faces message. However, in 1.1 the seam debug page is shown instead.
If I turn off debug in components.xml it works again but I then can't look at the debug page at all.
>From looking at the code the debug page is triggered by the ExceptionInterceptor which has the code:
| boolean outermost = invocation.getContextData().get("org.jboss.seam.outermostExceptionInterceptor")==null;
| invocation.getContextData().put("org.jboss.seam.outermostExceptionInterceptor", true);
| try
| {
| return invocation.proceed();
| }
| catch (Exception e)
| {
| if ( outermost && FacesContext.getCurrentInstance()!=null )
| {
| return Exceptions.instance().handle(e);
| }
| else
| {
| throw e;
| }
| }
|
when I debugged it I found that the contextData on the invocationContext was different on the call to the second bean than on the initial JSF call to the first bean so the outermost flag was true in both cases.
Does anybody else have it working doing a similar thing ? given all the other messages here I wouldn't be surprised if its a config issue
(I haven't used exceptions.xml at all yet)
I'm using Seam 1.1.0.CR1, JBoss 4.0.5.GA, Facelets 1.1.11, myFaces 1.1.4, ajax4jsf 1.0.3
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=3989467#3989467
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=3989467
19Â years, 5Â months
[JBoss Seam] - Seam 1.1 CR1 - IceFaces bug?
by marcin777
I repeat my question about IceFaces, in Seam.
Does anyone tryed to use TabbedPane in Seam-IceFaces.
Why when I add TabSet, to example it's rendered without graphic?
Tab works fine but i see only frames without graphic! Is this bug, or is this my problem? I tryed add tabset to Icefaces example from Seam 1.1 CR.1 and have same problem.
I've worked on clear IceFaces project (wihout Seam) on TabSet and they're rendered very nice.
Code:
<h:form id="myForm">
<ice:panelGrid>
<ice:panelTabSet selectedIndex="1" tabPlacement="top">
<ice:panelTab label="Tab 1">Hello 1
</ice:panelTab>
<ice:panelTab label="Tab 2">Hello 2
</ice:panelTab>
<ice:panelTab label="Tab 3">Hello 3
</ice:panelTab>
</ice:panelTabSet>
</ice:panelGrid>
</h:form>
Did you try Gavin to use Tab Set in IceFaces implemented in Seam?
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=3989462#3989462
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=3989462
19Â years, 5Â months