how to prevent UI block

Find out how to get things done with Servoy. Post how YOU get things done with Servoy

how to prevent UI block

Postby victor.rojo » Tue Apr 05, 2011 10:29 am

Hi,
I'm developing a solution where files are stored to the database. The files aren´t too big (2Mb max size), but when the record data is saved (databaseManager.saveData()) it blocks the UI (a 2Mb file blocks the UI about 20-40 seconds).
Is there any way to prevent this block?
Best regards/Un saludo,

Victor Rojo
Developer

NeoCursar, S.L. - Developers Team
--
Servoy 5.2.8 - build 1016 / Version: 6.0.2 - build 1222
Mac OS X 10.7
victor.rojo
 
Posts: 74
Joined: Mon Jan 11, 2010 1:49 pm

Re: how to prevent UI block

Postby jcompagner » Tue Apr 05, 2011 11:24 am

if it really takes 20-40 second to upload the 2MB file then you can't do much about it if you want to store them in the db.

You could use the file plugin to save them on disk on the server using the streaming features. (streaming happens in background)
or you could use the headlessclient plugin to do the save on the server, and call queueMethod() on the JSClient to stream it to the server and that client there then saves it.
Johan Compagner
Servoy
User avatar
jcompagner
 
Posts: 8829
Joined: Tue May 27, 2003 7:26 pm
Location: The Internet

Re: how to prevent UI block

Postby victor.rojo » Tue Apr 05, 2011 2:58 pm

jcompagner wrote:you could use the headlessclient plugin to do the save on the server, and call queueMethod() on the JSClient to stream it to the server and that client there then saves it.


Thanks Johan, I'll try this approach.
Best regards/Un saludo,

Victor Rojo
Developer

NeoCursar, S.L. - Developers Team
--
Servoy 5.2.8 - build 1016 / Version: 6.0.2 - build 1222
Mac OS X 10.7
victor.rojo
 
Posts: 74
Joined: Mon Jan 11, 2010 1:49 pm

Re: how to prevent UI block

Postby irennie » Tue Apr 05, 2011 5:32 pm

There is also a third party plugin from IT2BE (http://www.servoycomponents.com) called DataStream that streams files to the database (or to the server file system) in the background.
Iain Rennie
Asset Guardian Solutions Limited
http://www.assetguardian.com
User avatar
irennie
 
Posts: 27
Joined: Fri Jun 11, 2010 3:24 pm
Location: Livingston, UK


Return to How To

Who is online

Users browsing this forum: No registered users and 5 guests