long background database task

30 views
Skip to first unread message

Andrzej Skalski

unread,
Feb 13, 2015, 8:13:11 PM2/13/15
to lif...@googlegroups.com
Hi,

I am writing an web app, that once in a while consumes some large xml files in order to update it's database. A typical scenario is that user uploads a 10-mb file, and around 3000 insertions/updates take place. Now they are being called from snippet code, which is probably bad.

This happens to timeout ajaxCall, and I receive "java.lang.RuntimeException: Exception while executing statement : FATAL: terminating connection due to administrator command" from PostgreSQL. I am not sure if it's because of timeout, or whether my provider does not like such peaks. In the latter case I should probably also schelude breaks between batches of insertions.

I know I should probably rewrite the method to "Comet", but I never used it and I don't know how. Can anyone point me to a tutorial method => background method?

Kindest Regards
Andrzej Skalski

Diego Medina

unread,
Feb 13, 2015, 8:24:43 PM2/13/15
to Lift
I think I have just the post for you :)



hope it helps.

Diego

--
--
Lift, the simply functional web framework: http://liftweb.net
Code: http://github.com/lift
Discussion: http://groups.google.com/group/liftweb
Stuck? Help us help you: https://www.assembla.com/wiki/show/liftweb/Posting_example_code

---
You received this message because you are subscribed to the Google Groups "Lift" group.
To unsubscribe from this group and stop receiving emails from it, send an email to liftweb+u...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.



--
Diego Medina
Lift/Scala consultant
di...@fmpwizard.com
http://fmpwizard.telegr.am

Andrzej Skalski

unread,
Feb 18, 2015, 10:48:35 AM2/18/15
to lif...@googlegroups.com
hi Diego,

yes, the blog post is very informative. I am just wondering if this is a correct way to do it.

Furthermore, do you possibly have a build.sbt file for this example?

Kindest Regards
Andrzej Skalski
Reply all
Reply to author
Forward
0 new messages