[JBoss Seam] - Re: Update transactions occurring prematurely in Seam app
by asookazian
I tried using the following and in the debugger I'm seeing that in myAuditList (3rd param in action method) that row's value for the radio button clicked 'yes' is null. If I remove the 'bypassUpdates' from a4j:support, the value shows as true. I tried this twice to make sure...
xhtml:
<h:selectOneRadio id="accountApprovedRB" value="#{myRow[1].icomsAccountApproved}">
|
| <a4j:support event="onclick"
| oncomplete="processNote(#{myAuditList.getRowIndex()}, 'accountApproved')"
| action="#{noteAction.setCurrentData(myAuditList.getRowIndex(), 'accountApproved', myAuditList)}"
| ajaxSingle="true"
| bypassUpdates="true"
| reRender="mainForm"/>
SFSB:
| @PersistenceContext(unitName="boIcomsSecurityAudit", type=PersistenceContextType.EXTENDED)
| private EntityManager emICOMS;
|
| @Begin(join=true, flushMode=FlushModeType.MANUAL) // <-- use this with SMPC
| //@Begin(join=true)
| @Factory("myAuditList")
| public void findAuditList()
| {
| Boolean hardCodeEmployeeId = Boolean.parseBoolean(SecurityAuditProperties.getPropertyObject().getProperty(SecurityAuditConstants.HARD_CODE_EMPLOYEE_ID));
| Integer employeeId;
|
| if (hardCodeEmployeeId) { //if true in props file then we're testing only...
|
| employeeId = peerAction.getEmployeeId();
|
| if (employeeId == null) {
|
| employeeId = Integer.parseInt(SecurityAuditProperties.getPropertyObject().getProperty(SecurityAuditConstants.EMPLOYEE_ID)); //using btkach id for now;
| }
| }
| else {
| log.info("in getAuditList(): user.getUserId() = " + user.getUserId() + " user.getBillingId() = " + user.getBillingId());
|
| //employeeId = getEmployeeId();
|
| employeeId = peerAction.getEmployeeId();
|
| }
| myAuditList = emICOMS.createQuery("SELECT gem, tsaw "+
| "FROM TblSecurityAuditWorking tsaw, "+
| "GlobalEmployeeMaster gem "+
| "WHERE tsaw.id.siteId = gem.id.siteId "+
| "AND tsaw.id.employeeNumber = gem.id.employeeNumber "+
| "AND tsaw.reportToId = :employeeId " +
| "ORDER BY tsaw.id.employeeNumber ASC")
| .setParameter("employeeId", employeeId)
| .getResultList();
|
| //instantiate null valued noteList
| noteAction.initialize(myAuditList);
|
| log.info("in findAuditList(): myAuditList.size() = " + myAuditList.size());
|
| noteLoadList = emICOMS.createQuery("SELECT saw.id.siteId, saw.id.employeeNumber, "+
| "("+
| "SELECT count(san) as AcctApprovedNoteCount "+
| "FROM TblSecurityAuditNote san "+
| "WHERE san.siteId = saw.id.siteId "+
| "AND san.employeeNumber = saw.id.employeeNumber "+
| "AND san.noteType = 'accountApproved' "+
| ") as AcctApprovedCount, "+
| "("+
| "SELECT count(san) as secLevelApprovedNoteCount "+
| "FROM TblSecurityAuditNote san "+
| "WHERE san.siteId = saw.id.siteId "+
| "AND san.employeeNumber = saw.id.employeeNumber "+
| "AND san.noteType = 'secLevelApproved' "+
| ") as secLevelApprovedCount, "+
| "("+
| "SELECT count(san) as adjLimitApprovedNoteCount "+
| "FROM TblSecurityAuditNote san "+
| "WHERE san.siteId = saw.id.siteId "+
| "AND san.employeeNumber = saw.id.employeeNumber "+
| "AND san.noteType = 'adjLimitApproved' "+
| ") as adjLimitApprovedCount "+
| "FROM TblSecurityAuditWorking saw")
| .getResultList();
|
|
|
| log.info("in findAuditList(): noteLoadList.size() = " + noteLoadList.size());
|
|
|
| }
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4114730#4114730
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4114730
18 years, 4 months
[JBoss Seam] - Dynamically rendering more than one select elements in a for
by kindor
I'm trying to dynamically build a form by looping over a set of fields that have a renderer attribute, which is used to tell what widget should be used to renderer them.
The problem I'm facing is when the widget is a select element. In this case, the nested f:selectItems load their data from a bean that, if I understand well the documentation, cannot be specified at runtime. Thus, I have hardcoded the bean that provides the data to the select boxes (dataProviderBean.selectItems in my simplified example below). But when the form is rendering, I haven't found any mean by which dataProviderBean can know which select element is being populated.
What's the best approach for solving this problem ?
| <h:dataTable var="field" value="#{fieldSet}">
| <h:column>
| #{field.name}
| </h:column>
|
| <h:column>
| <h:inputText value="#{field.value}"
| rendered="#{field.renderer.isInputText}"/>
|
| <h:selectManyListbox value="#{field.value}"
| rendered="#{field.renderer.isManyListBox}">
| <f:selectItems value="#{dataProviderBean.selectItems}"/>
| </h:selectManyListbox>
|
| <h:selectManyCheckbox value="#{field.value}"
| rendered="#{field.renderer.isManyselectManyCheckbox}">
| <f:selectItems value="#{dataProviderBean.selectItems}"/>
| </h:selectManyCheckbox>
| </h:column>
| </h:dataTable>
|
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4114728#4114728
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4114728
18 years, 4 months
[JBossCache] - Replication exception when node lost
by FredrikJ
Hi.
We are currently running a setup with jboss cache 2.1.0 CR2 and JGroups 2.6.1.
When disconnecting one node from a cluster of two nodes, the first node will often catch exception below.
Replication exception : org.jboss.cache.ReplicationException: rsp=sender=192.168.1.112:32904, retval=null, received=false, suspected=true
| org.jboss.cache.ReplicationException: rsp=sender=192.168.1.112:32904, retval=null, received=false, suspected=true
| View changed: [192.168.1.135:50649|4] [192.168.1.135:50649]
| at org.jboss.cache.CacheImpl.callRemoteMethods(CacheImpl.java:2060)
| at org.jboss.cache.CacheImpl.callRemoteMethods(CacheImpl.java:1952)
| at org.jboss.cache.CacheImpl.callRemoteMethods(CacheImpl.java:1945)
| at org.jboss.cache.CacheImpl.callRemoteMethods(CacheImpl.java:2091)
| at org.jboss.cache.RPCManagerImpl.callRemoteMethods(RPCManagerImpl.java:70)
| at org.jboss.cache.interceptors.BaseRpcInterceptor.replicateCall(BaseRpcInterceptor.java:106)
| at org.jboss.cache.interceptors.BaseRpcInterceptor.replicateCall(BaseRpcInterceptor.java:69)
| at org.jboss.cache.interceptors.ReplicationInterceptor.handleReplicatedMethod(ReplicationInterceptor.java:118)
| at org.jboss.cache.interceptors.ReplicationInterceptor.invoke(ReplicationInterceptor.java:90)
| at org.jboss.cache.interceptors.Interceptor.invoke(Interceptor.java:77)
| at org.jboss.cache.interceptors.NotificationInterceptor.invoke(NotificationInterceptor.java:32)
| at org.jboss.cache.interceptors.Interceptor.invoke(Interceptor.java:77)
| at org.jboss.cache.interceptors.TxInterceptor.handleNonTxMethod(TxInterceptor.java:298)
| at org.jboss.cache.interceptors.TxInterceptor.invoke(TxInterceptor.java:130)
| at org.jboss.cache.interceptors.Interceptor.invoke(Interceptor.java:77)
| at org.jboss.cache.interceptors.CacheMgmtInterceptor.invoke(CacheMgmtInterceptor.java:107)
| at org.jboss.cache.interceptors.Interceptor.invoke(Interceptor.java:77)
| at org.jboss.cache.interceptors.InvocationContextInterceptor.invoke(InvocationContextInterceptor.java:62)
| at org.jboss.cache.CacheImpl.invokeMethod(CacheImpl.java:4004)
| at org.jboss.cache.CacheImpl.put(CacheImpl.java:1483)
| at org.jboss.cache.CacheImpl.put(CacheImpl.java:1468)
| at org.jboss.cache.UnversionedNode.addChild(UnversionedNode.java:353)
| at CacheTest$Producer.run(CacheTest.java:129)
| at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:417)
| at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:269)
| at java.util.concurrent.FutureTask.run(FutureTask.java:123)
| at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:650)
| at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:675)
| at java.lang.Thread.run(Thread.java:595)
| Caused by: org.jboss.cache.SuspectException: Suspected member: 192.168.1.112:32904
| at org.jboss.cache.CacheImpl.callRemoteMethods(CacheImpl.java:2054)
| ... 28 more
|
It looks like the cache is throwing an exception since the recipient is no longer with us (well, suspected at least).
1. Is this new behavior in 2.1? I can't remember having to catch these exceptions before when a member left the cluster.
2. What happens if the groups is 10 nodes and one member leaves? Will the replication be discarded, replicated to all but the suspected member or is it inconclusive? I tried to find some documentation regarding this but could not find any.
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4114715#4114715
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4114715
18 years, 4 months
[JBoss jBPM] - How to read Controller variables in an Action ?
by francis1970
Hi all !
I have a state which has associated a Controller
<start-state name="start">
| <task name="task1" blocking="true" swimlane="ernie">
| <controller>
| <variable name="var1" access="read"></variable>
| <variable name="var2" access="read"></variable>
| </controller>
| </task>
| <transition name="to_state" to="first"> </transition>
| </start-state>
Now in the next state I fire an action when node is entered....
<state name="first">
| <event type="node-enter">
| <action name="action1"></action>
| </event>
| <transition name="to_end" to="end">
| <action name="action" class="com.sample.action.MyActionHandler">
| <message>About to finish!</message>
| </action>
| </transition>
| </state>
I'd like to read the Controller variables in the Action....
but I get null.....
String var1 = (String)context.getContextInstance().getVariable("var1");
returns null
How can I read Controller variables ? if it's not possible to do it, how can I inject those variables in my Java code ?
Thanks a lot
Francesco
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4114712#4114712
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4114712
18 years, 4 months