In my controller.xml, I defined the following
request-map, which event type is java.
<request-map uri="EditResourceHeaderList">
 <security auth="true" https="true"/>
 <event type="java"
path="org.ofbiz.product.resourcemapping.ResourceHeaderListServices"
invoke="editResourceHeaderList"/>
 <response name="success" type="none"/>
 <response name="error" type="none"/>
</request-map>

In my editResourceHeaderList function, I will remove
old record and create a new record. How can I make
sure two steps in one database transaction?

GenericValue oldResourceHeaderList =
delegator.findByPrimaryKey(entity, UtilMisc.toMap(
                    "headerId", oldHeaderId,
"resourceId", oldResourceId));
if (oldResourceHeaderList != null) {
                oldResourceHeaderList.remove();
            }
            
            GenericValue newResourceHeaderList =
delegator.makeValue(entity, UtilMisc.toMap(
                    "headerId", headerId,
"resourceId", resourceId));
            delegator.create(newResourceHeaderList);


Thanks a lot.
Tomcat Acec


      __________________________________________________________________
Ask a question on any topic and get answers from real people. Go to Yahoo! 
Answers and share what you know at http://ca.answers.yahoo.com

Reply via email to