Regarding -Order notification mails

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

Regarding -Order notification mails

Vamsi
Hi ,

                As per my requirement i had changed the
sendOrderCompleteNotification mode to sync but  it is giving  exception
after sending the mail like unable to insert into ordernotification,but if I
changed that one from sync to async it is working fine without any
exception.May I know the purpose of keeping them as asynchronous services
instead of synchronous.I am posting the changes I made and as well as
exception repost for your reference.

                     I thankful to everyone responded
regards
Vamsi


     <eca service="changeOrderStatus" event="commit" run-on-error="false">
        <condition field-name="statusId" operator="equals"
value="ORDER_COMPLETED"/>
        <condition-field field-name="statusId" operator="not-equals"
to-field-name="oldStatusId"/>
        <action service="resetGrandTotal" mode="sync"/>
        <action service="sendOrderCompleteNotification" mode="async"
persist="true"/>
    </eca>

--- exception report
----------------------------------------------------------
     [java] Failure in create operation for entity [OrderNotification]:
org.ofbiz.entity.GenericEntityException: Exception while inserting the
following entity: [GenericEntity:OrderNotification][createdStamp,2007-03-12
17:10:15.082(java.sql.Timestamp)][createdTxStamp,2007-03-12 17:10:03.65(
java.sql.Timestamp)][emailType,PRDS_ODR_CHANGE(java.lang.String)][lastUpdatedStamp,2007-03-12
17:10:15.082(java.sql.Timestamp)][lastUpdatedTxStamp,2007-03-12 17:10:03.65(
java.sql.Timestamp)][notificationDate,2007-03-12 17:10:15.082(
java.sql.Timestamp)][orderId,11252(java.lang.String
)][orderNotificationId,10230(java.lang.String)] (while inserting:
[GenericEntity:OrderNotification][createdStamp,2007-03-12 17:10:15.082(
java.sql.Timestamp)][createdTxStamp,2007-03-12 17:10:03.65(
java.sql.Timestamp)][emailType,PRDS_ODR_CHANGE(java.lang.String)][lastUpdatedStamp,2007-03-12
17:10:15.082(java.sql.Timestamp)][lastUpdatedTxStamp,2007-03-12 17:10:03.65(
java.sql.Timestamp)][notificationDate,2007-03-12 17:10:15.082(
java.sql.Timestamp)][orderId,11252(java.lang.String
)][orderNotificationId,10230(java.lang.String)] (SQL Exception while
executing the following:INSERT INTO ORDER_NOTIFICATION
(ORDER_NOTIFICATION_ID, ORDER_ID, EMAIL_TYPE, COMMENTS, NOTIFICATION_DATE,
LAST_UPDATED_STAMP, LAST_UPDATED_TX_STAMP, CREATED_STAMP, CREATED_TX_STAMP)
VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?) (Lock wait timeout exceeded; try
restarting transaction))). Rolling back transaction.
     [java] Exception: org.ofbiz.entity.GenericEntityException
     [java] Message: Exception while inserting the following entity:
[GenericEntity:OrderNotification][createdStamp,2007-03-12 17:10:15.082(
java.sql.Timestamp)][createdTxStamp,2007-03-12 17:10:03.65(
java.sql.Timestamp)][emailType,PRDS_ODR_CHANGE(java.lang.String)][lastUpdatedStamp,2007-03-12
17:10:15.082(java.sql.Timestamp)][lastUpdatedTxStamp,2007-03-12 17:10:03.65(
java.sql.Timestamp)][notificationDate,2007-03-12 17:10:15.082(
java.sql.Timestamp)][orderId,11252(java.lang.String
)][orderNotificationId,10230(java.lang.String)] (while inserting:
[GenericEntity:OrderNotification][createdStamp,2007-03-12 17:10:15.082(
java.sql.Timestamp)][createdTxStamp,2007-03-12 17:10:03.65(
java.sql.Timestamp)][emailType,PRDS_ODR_CHANGE(java.lang.String)][lastUpdatedStamp,2007-03-12
17:10:15.082(java.sql.Timestamp)][lastUpdatedTxStamp,2007-03-12 17:10:03.65(
java.sql.Timestamp)][notificationDate,2007-03-12 17:10:15.082(
java.sql.Timestamp)][orderId,11252(java.lang.String
)][orderNotificationId,10230(java.lang.String)] (SQL Exception while
executing the following:INSERT INTO ORDER_NOTIFICATION
(ORDER_NOTIFICATION_ID, ORDER_ID, EMAIL_TYPE, COMMENTS, NOTIFICATION_DATE,
LAST_UPDATED_STAMP, LAST_UPDATED_TX_STAMP, CREATED_STAMP, CREATED_TX_STAMP)
VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?) (Lock wait timeout exceeded; try
restarting transaction)))
     [java] ---- stack trace
---------------------------------------------------------------
     [java] org.ofbiz.entity.GenericEntityException: Exception while
inserting the following entity:
[GenericEntity:OrderNotification][createdStamp,2007-03-12 17:10:15.082(
java.sql.Timestamp)][createdTxStamp,2007-03-12 17:10:03.65(
java.sql.Timestamp)][emailType,PRDS_ODR_CHANGE(java.lang.String)][lastUpdatedStamp,2007-03-12
17:10:15.082(java.sql.Timestamp)][lastUpdatedTxStamp,2007-03-12 17:10:03.65(
java.sql.Timestamp)][notificationDate,2007-03-12 17:10:15.082(
java.sql.Timestamp)][orderId,11252(java.lang.String
)][orderNotificationId,10230(java.lang.String)] (while inserting:
[GenericEntity:OrderNotification][createdStamp,2007-03-12 17:10:15.082(
java.sql.Timestamp)][createdTxStamp,2007-03-12 17:10:03.65(
java.sql.Timestamp)][emailType,PRDS_ODR_CHANGE(java.lang.String)][lastUpdatedStamp,2007-03-12
17:10:15.082(java.sql.Timestamp)][lastUpdatedTxStamp,2007-03-12 17:10:03.65(
java.sql.Timestamp)][notificationDate,2007-03-12 17:10:15.082(
java.sql.Timestamp)][orderId,11252(java.lang.String
)][orderNotificationId,10230(java.lang.String)] (SQL Exception while
executing the following:INSERT INTO ORDER_NOTIFICATION
(ORDER_NOTIFICATION_ID, ORDER_ID, EMAIL_TYPE, COMMENTS, NOTIFICATION_DATE,
LAST_UPDATED_STAMP, LAST_UPDATED_TX_STAMP, CREATED_STAMP, CREATED_TX_STAMP)
VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?) (Lock wait timeout exceeded; try
restarting transaction)))
     [java] org.ofbiz.entity.datasource.GenericDAO.insert(GenericDAO.java
:121)
     [java] org.ofbiz.entity.datasource.GenericHelperDAO.create(
GenericHelperDAO.java:66)
     [java] org.ofbiz.entity.GenericDelegator.create(GenericDelegator.java
:561)
     [java] org.ofbiz.minilang.method.entityops.CreateValue.exec(
CreateValue.java:65)
     [java] org.ofbiz.minilang.SimpleMethod.runSubOps(SimpleMethod.java:920)
     [java] org.ofbiz.minilang.SimpleMethod.exec(SimpleMethod.java:560)
     [java] org.ofbiz.minilang.SimpleMethod.runSimpleMethod(
SimpleMethod.java:107)
     [java] org.ofbiz.minilang.SimpleMethod.runSimpleService(
SimpleMethod.java:89)
     [java] org.ofbiz.minilang.SimpleServiceEngine.serviceInvoker(
SimpleServiceEngine.java:77)
     [java] org.ofbiz.minilang.SimpleServiceEngine.runSync(
SimpleServiceEngine.java:52)
     [java] org.ofbiz.service.ServiceDispatcher.runSync(
ServiceDispatcher.java:338)
     [java] org.ofbiz.service.ServiceDispatcher.runSync(
ServiceDispatcher.java:212)
     [java] org.ofbiz.service.GenericDispatcher.runSync(
GenericDispatcher.java:114)
     [java] org.ofbiz.service.eca.ServiceEcaAction.runAction(
ServiceEcaAction.java:100)
     [java] org.ofbiz.service.eca.ServiceEcaRule.eval(ServiceEcaRule.java
:122)
     [java] org.ofbiz.service.eca.ServiceEcaUtil.evalRules(
ServiceEcaUtil.java:164)
     [java] org.ofbiz.service.ServiceDispatcher.runSync(
ServiceDispatcher.java:371)
     [java] org.ofbiz.service.ServiceDispatcher.runSync(
ServiceDispatcher.java:212)
     [java] org.ofbiz.service.GenericDispatcher.runSync(
GenericDispatcher.java:114)
     [java] org.ofbiz.service.eca.ServiceEcaAction.runAction(
ServiceEcaAction.java:100)
     [java] org.ofbiz.service.eca.ServiceEcaRule.eval(ServiceEcaRule.java
:122)
     [java] org.ofbiz.service.eca.ServiceEcaUtil.evalRules(
ServiceEcaUtil.java:164)
     [java] org.ofbiz.service.ServiceDispatcher.runSync(
ServiceDispatcher.java:371)
     [java] org.ofbiz.service.ServiceDispatcher.runSync(
ServiceDispatcher.java:212)
     [java] org.ofbiz.service.GenericDispatcher.runSync(
GenericDispatcher.java:114)
     [java] org.ofbiz.order.order.OrderServices.checkItemStatus(
OrderServices.java:1566)
     [java] sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
     [java] sun.reflect.NativeMethodAccessorImpl.invoke(
NativeMethodAccessorImpl.java:39)
     [java] sun.reflect.DelegatingMethodAccessorImpl.invoke(
DelegatingMethodAccessorImpl.java:25)
     [java] java.lang.reflect.Method.invoke(Method.java:585)
     [java] org.ofbiz.service.engine.StandardJavaEngine.serviceInvoker(
StandardJavaEngine.java:92)
     [java] org.ofbiz.service.engine.StandardJavaEngine.runSync(
StandardJavaEngine.java:54)
     [java] org.ofbiz.service.ServiceDispatcher.runSync(
ServiceDispatcher.java:338)
     [java] org.ofbiz.service.ServiceDispatcher.runSync(
ServiceDispatcher.java:212)
     [java] org.ofbiz.service.GenericDispatcher.runSync(
GenericDispatcher.java:114)
     [java] org.ofbiz.service.eca.ServiceEcaAction.runAction(
ServiceEcaAction.java:100)
     [java] org.ofbiz.service.eca.ServiceEcaRule.eval(ServiceEcaRule.java
:122)
     [java] org.ofbiz.service.eca.ServiceEcaUtil.evalRules(
ServiceEcaUtil.java:164)
     [java] org.ofbiz.service.ServiceDispatcher.runSync(
ServiceDispatcher.java:371)
     [java] org.ofbiz.service.ServiceDispatcher.runSync(
ServiceDispatcher.java:212)
     [java] org.ofbiz.service.GenericDispatcher.runSync(
GenericDispatcher.java:114)
     [java] org.ofbiz.webapp.event.ServiceEventHandler.invoke(
ServiceEventHandler.java:292)
     [java] org.ofbiz.webapp.control.RequestHandler.runEvent(
RequestHandler.java:408)
     [java] org.ofbiz.webapp.control.RequestHandler.doRequest(
RequestHandler.java:243)
     [java] org.ofbiz.webapp.control.ControlServlet.doGet(
ControlServlet.java:183)
     [java] javax.servlet.http.HttpServlet.service(HttpServlet.java:690)
     [java] javax.servlet.http.HttpServlet.service(HttpServlet.java:803)
     [java] org.apache.catalina.core.ApplicationFilterChain.internalDoFilter
(ApplicationFilterChain.java:290)
     [java] org.apache.catalina.core.ApplicationFilterChain.doFilter(
ApplicationFilterChain.java:206)
     [java] org.ofbiz.webapp.control.ContextFilter.doFilter(
ContextFilter.java:249)
     [java] org.apache.catalina.core.ApplicationFilterChain.internalDoFilter
(ApplicationFilterChain.java:235)
     [java] org.apache.catalina.core.ApplicationFilterChain.doFilter(
ApplicationFilterChain.java:206)
     [java] org.apache.catalina.core.StandardWrapperValve.invoke(
StandardWrapperValve.java:228)
     [java] org.apache.catalina.core.StandardContextValve.invoke(
StandardContextValve.java:175)
     [java] org.apache.catalina.core.StandardHostValve.invoke(
StandardHostValve.java:128)
     [java] org.apache.catalina.valves.ErrorReportValve.invoke(
ErrorReportValve.java:105)
     [java] org.apache.catalina.core.StandardEngineValve.invoke(
StandardEngineValve.java:109)
     [java] org.apache.catalina.valves.AccessLogValve.invoke(
AccessLogValve.java:542)
     [java] org.apache.catalina.connector.CoyoteAdapter.service(
CoyoteAdapter.java:212)
     [java] org.apache.jk.server.JkCoyoteHandler.invoke(JkCoyoteHandler.java
:200)
     [java] org.apache.jk.common.HandlerRequest.invoke(HandlerRequest.java
:283)
     [java] org.apache.jk.common.ChannelSocket.invoke(ChannelSocket.java
:767)
     [java] org.apache.jk.common.ChannelSocket.processConnection(
ChannelSocket.java:697)
     [java] org.apache.jk.common.ChannelSocket$SocketConnection.runIt(
ChannelSocket.java:889)
     [java] org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(
ThreadPool.java:686)
     [java] java.lang.Thread.run(Thread.java:595)
Reply | Threaded
Open this post in threaded view
|

Re: Regarding -Order notification mails

Vamsi
Hi,

 One more question along with that ,if we keep the mode of the services
called as async they  are added to joblist. May I know what is the strategy
followed by the jobpoller to run theses services and how long it will take
to send the mail notifications

regards
Vamsi