In my experience there is a reason why most of the erp provide such long
tasks as jobs. Because, if it is a long task then it is better to do in
separate async jobs (else you might get a browser timeout ).
My suggestion is to make this as a service with a long timeout and run it
as a job.

On Tue, May 21, 2013 at 9:49 PM, Robert G. <g...@mercon24.de> wrote:

> hey guys, I have the following question (maybe groovy basics)...:
>
> I do read a csv file with opencsv, so I get it line by line within a while
> loop. Within this loop I call a simple method service to store selected
> data
> from each line in database. With that I thought not to overload my memory,
> because only one line of Csv should be in memory. But now I realized, that
> I
> get a transaction timeout error from my service. It also does not store
> anything in database (with just 100 entries it works fine, but not wiht
> 10.000 entries and more). The transaction is rolled back. So I believe that
> it tries to use just one transaction for all data? Could that maybe happen
> because the while loop does not wait for finishing the transaction and just
> push's more data to it? So if is so, how could I wait for the end of the
> service before taking the next line from my csv (next while loop).
>
> my loop is like that:
>
>
> /...some code....
>
> while ((nextLine = reader.readNext()) != null) {
>                 dispatcher.runSync("exampleService", [userLogin:
> userLogin, var1:var1,
> var2:var2]);
> }
> ...some code..../
>
> any help I appreciate!
>
> greetings, robert
>
>
>
> --
> View this message in context:
> http://ofbiz.135035.n4.nabble.com/Groovy-call-a-service-within-a-while-loop-wait-notify-tp4641435.html
> Sent from the OFBiz - User mailing list archive at Nabble.com.
>



-- 
Thanks,
Deepak Agarwal,

Mobile: +91 9501190044

Reply via email to