[EJB 3.0 Users] - EntityBean loading: immediate update after read an entity
by tschwarz
Hi all,
I have a strange behavior of my EJB 3.
As soon as I read an entity using the EntityManager I can see an select statement send to the database, but followed by an immediate update statement that is send to the database.
I have a couple of finder-methods in my session bean. That methods are using the EntityManger to find my entity beans. Even a simple invocation of a find by primary key method is leads to an immediate update.
After every update the entity's version is changed, making it impossible to save my real changes, that are coming from the presentation layer.
Any idea what might be the reason for those strange updates? How can I change this?
Code sniplet:
| @Stateless
| public class OrderServiceBean {
|
| @PersistenceContext
| private EntityManager em;
|
| public Order findOrderById(Long id) {
| return em.find(Vorgang.class, id);
| }
|
| }
|
Thanks for your help in advance
Thorsten
View the original post : http://www.jboss.org/index.html?module=bb&op=viewtopic&p=4251250#4251250
Reply to the post : http://www.jboss.org/index.html?module=bb&op=posting&mode=reply&p=4251250
16 years, 8 months
[Installation, Configuration & Deployment] - Re: ServiceBindingSet
by bstansberry@jboss.com
This comment needs to be fixed:
<!-- Set of bindings to which the "offset by X" approach can't be applied -->
Should be something more like this:
<!-- Set of bindings that are specific to this ServiceBindingSet -->
https://jira.jboss.org/jira/browse/JBAS-7206
You then "fix" the port value (i.e. prevent the offset being applied) by setting the "fixedPort" property, same as you would for one of the elements in the StandardBindings set.
| <bean name="Ports03Bindings" class="org.jboss.services.binding.impl.ServiceBindingSet">
| <constructor>
| <!-- The name of the set -->
| <parameter>ports-03</parameter>
| <!-- Default host name -->
| <parameter>${jboss.bind.address}</parameter>
| <!-- The port offset -->
| <parameter>400</parameter>
| <!-- Set of bindings to which the "offset by X" approach can't be applied -->
| <parameter>
| <set elementClass="org.jboss.services.binding.ServiceBindingMetadata">
| <bean class="org.jboss.services.binding.ServiceBindingMetadata">
| <property name="serviceName">jboss.web:service=WebServer</property>
| <property name="port">8700</property>
| <property name="description">JBoss Web HTTP connector socket; also drives the values for the HTTPS and AJP sockets
| </property>
| <property name="serviceBindingValueSourceConfig"><inject bean="JBossWebConnectorXSLTConfig"/></property>
| <property name="fixedPort">true</property>
| </bean>
| <bean class="org.jboss.services.binding.ServiceBindingMetadata">
| <property name="serviceName">jboss:service=Naming</property>
| <property name="bindingName">Port</property>
| <property name="port">1799</property>
| <property name="description">The listening socket for the Naming service</property>
| <property name="fixedPort">true</property>
| </bean>
| </set>
| </parameter>
| </constructor>
| </bean>
|
That's admittedly non-intuitive. The code is written such that the "fixedPort" property controls whether the offset is applied, no matter where the ServiceBindingMetadata comes from. That could be changed, but we'd need to add a mechanism to allow people to say fixedPort=false on an override binding. For example, make the field a Boolean with a null default and add a isFixedPortSet() getter.
View the original post : http://www.jboss.org/index.html?module=bb&op=viewtopic&p=4251246#4251246
Reply to the post : http://www.jboss.org/index.html?module=bb&op=posting&mode=reply&p=4251246
16 years, 8 months
[jBPM Users] - Transition navigation
by TejJBPM
Hi all,
I have two nodes called approve and reject in my task node.
I want to be able to code the conditional transition in my JSF..
If approve is clicked go to - myportal.jsf
IF reject is clicked go to the next transition and show the corresponding form - basically a URL with the task id..
here is my code
<j4j:loadTask id="#{id}" target="#{task}"/>
| <j4j:completeTask task="#{task}" transition="#{transition.name}"/>
| <n:nav outcome="success" url="myportal.jsf" storeMessages="true"/>
| <n:nav outcome="error" redirect="true" storeMessages="true"/>
My confusion is how to calculate the outcome as reject - where to set it? or I want to give a condition in my nav url checking the transition name and then redirect to the corresponding page. Currently both are redirected to myportal.jsf..please help..
View the original post : http://www.jboss.org/index.html?module=bb&op=viewtopic&p=4251234#4251234
Reply to the post : http://www.jboss.org/index.html?module=bb&op=posting&mode=reply&p=4251234
16 years, 8 months