[EJB 3.0] - How to update entities depending on state in other entity
by liegler.maurer@gmx.at
Newbie case is:
Entity bean A relates to entity bean B via "AtoB".
Entity bean B has property "state"
-) as enum with possible values {1,2}
-) current value of 1 in database
-) just updated (but not persisted) property in entity bean B to 2.
Two users U1, U2 try to subsequently update the equal entity bean A.
Condition for update is to update Entity A only if A.AtoB.state = 1 in database. So if U1 commits udpate before U2 commits his update, U2 should be notified of "User U1 already ...blabla".
? 1) What is the right solution to assure this condition with JPQL/EJB3.0? Pros/Cons?
!) Use Update Query with following right refresh solution
!) Use Select with write lock, then update
!)...
? 2) How to detect if the update succedded/failed? Pros/Cons?
!) EJB Exception thrown, what type of
!) Update count = 0
!)...
Appreciate your help
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4002008#4002008
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4002008
19 years, 3 months
[JBoss Portal] - Error deploying JBoss Portal 2.4.1 on JBossAs 4.0.4.GA
by huff
-JBoss Portal Version -> JBoss Portal 2.4.1
-Did you get Portal from CVS? or download it -> downloaded binary version
-JBoss AS Version -> 4.0.4.GA
-Database Vendor and Version -> mysql Ver 14.12 Distrib 5.0.17c, for redhat-linux-gnu (x86_64) using readline 5.0
-JDBC Connector and Version -> mysql-connector-java-5.0.3-bin.jar
-OS Platform -> Red Hat Enterprise Linux AS release 4 (Nahant Update 4) 2.6.9-42.0.3.EL x86_64
Im trying to deploy jboss portal on JBossAs 4.0.4.GA. I think I have every thing set up correctly and my datasource is deployed however it fails deplying the portal, from console log:
--- MBEANS THAT ARE THE ROOT CAUSE OF THE PROBLEM ---
ObjectName: portal:service=Hibernate,type=PortalObject
State: FAILED
Reason: org.hibernate.MappingException: invalid configuration
I Depend On:
jboss.jca:service=DataSourceBinding,name=PortalDS
Depends On Me:
portal:container=PortalObject
ObjectName: portal:service=CMS
State: FAILED
Reason: org.jboss.util.NestedRuntimeException: - nested throwable: (java.l
ang.NullPointerException)
I Depend On:
jboss.jca:service=DataSourceBinding,name=PortalDS
portal:service=JAASLoginModule
portal:service=Hibernate,type=CMS
Depends On Me:
portal:commandFactory=CMSObject
cms.pm.cache:service=TreeCache
-further up the log I get these errors which I think to be the cause of the problem:
21:41:45,389 ERROR [JDBCExceptionReporter] Data truncation: Data too long fo
r column 'MODIFIABLE' at row 1
21:41:45,393 ERROR [PortletAppDeployment] Error when creating instances
org.hibernate.exception.GenericJDBCException: could not insert: [org.jboss.p
ortal.core.impl.model.instance.InstanceImpl]
at org.hibernate.exception.SQLStateConverter.handledNonSpecificExcep
tion(SQLStateConverter.java:103)
at org.hibernate.exception.SQLStateConverter.convert(SQLStateConvert
er.java:91)
at org.hibernate.exception.JDBCExceptionHelper.convert(JDBCException
Helper.java:43)
at org.hibernate.id.insert.AbstractReturningDelegate.performInsert(A
bstractReturningDelegate.java:40)
....
...
..
.
any ideas?
Thanks,
David
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4001992#4001992
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4001992
19 years, 3 months
[JBoss Seam] - Re: Seam coupling
by phpadm
Hi Petemuir,
Thank for your post.
I thought that the issue is: can seam connects other kinds of presentation layer?
Imagine that we've a pet story designed with JSF, Seam and some persistence layer. The client must check the feed by cell phone, for example. Could seam abstract the presentation layer and change it (swing)?
In this case, I guess (not sure) the seam couldn't be used, or the classes should be redesigned, abstracting business layer (from Session Bean) to separated layer and connect it to seam design, permitting both mobile and web clients.
If it couldn't do, shall Seam be removed (desperated situation) or other best solution could apply?
Imagine a XML config saying: "adding Mobile capability through dependency injection". It should be great.
I wait for some contribution.
we lies this issue to migrate to Seam.
I has appreciated the Conversation and http session hands off.
Thanks,
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4001989#4001989
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4001989
19 years, 3 months
[JBoss jBPM] - Re: Assigning a group to a task...jbpm3.2Alpha1
by webjavier
This method help to see datatable with the task for a group
public List getPooledTaskInstances() {
List pooledTaskInstances = null;
List poolIds = identityBean.getUserPoolIds();
if (poolIds!=null) {
pooledTaskInstances = jbpmBean.getJbpmContext().getTaskMgmtSession().findPooledTaskInstances(poolIds);
}
return pooledTaskInstances;
}
This method is in ParticipantBean.. and the datatable is:
<h:form>
<h4>Lista de tareas asignadas</h4>
<h:dataTable value="#{participantBean.pooledTaskInstances}" var="pooledTaskInstance" headerClass="tableheader" columnClasses="tablecell">
<h:column >
<f:facet name="header">
<h:outputText value="Task Form Link" />
</f:facet>
<h:commandLink action="#{taskBean.showTaskFormDePool}">
<f:param name="taskInstanceId" value="#{pooledTaskInstance.id}"/>
<h:outputText value="#{pooledTaskInstance.name}" />
</h:commandLink>
</h:column>
<h:column>
<f:facet name="header">
<h:outputText value="Process" />
</f:facet>
<h:outputText value="#{pooledTaskInstance.taskMgmtInstance.taskMgmtDefinition.processDefinition.name}" />
</h:column>
<h:column>
<f:facet name="header">
<h:outputText value="Version" />
</f:facet>
<h:outputText value="#{pooledTaskInstance.taskMgmtInstance.taskMgmtDefinition.processDefinition.version}" />
</h:column>
</h:dataTable>
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4001976#4001976
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4001976
19 years, 3 months