Source language: Translate to:

Images in BLOB fields

Questions about our Advanced Database plug-in

Moderator: Neosoft Support

Images in BLOB fields

Postby djpilot » Sun Jul 10, 2011 5:22 pm

Hi, I have a successfully working connection to a remote MySql database but have some trouble with storing/retrieving files inside the database.

My database is quite small (less than 200 records) and I need to store a single small file (about 100k) inside a field.

I have created a blob field and when I select the file to put in it, the entire publication freezes (it seems until the file has been uploaded into the database at the remote location).
When I open the table again (such as when I run the application) it takes quite some time as it seems its now downloading the file.


Is there anyway to have an 'upload' or 'download' progress indication for such items as an apparently 'frozen' application is not very good for the end user.


Thanks in advance.
djpilot
 
Posts: 21
Joined: Sun Jun 19, 2011 8:03 pm

Postby smartmedia » Sun Jul 10, 2011 10:36 pm

Hi..

This is a common problem of DBPro i have face. I don't think that it's a good idea to use blob field and specially for images. Every time you access a record DBPro will try to download a fresh copy of the file. That proccess will continue every time u move into other record. So you can imagine how difficult is to work.
A work around is to use URL of the image and combination of file download FTP upload.
Freeze is one major issue, happens almost every time you connect with a database in Internet. Specially if the connection is slow or disconnect during a process. DBPro doesn't have real time response to disconnect signals so you have to build a function to check if Internet is a live before send any commands.
Most of the times, when the app freezes doesn't unfreeze again, u need to shutdown the application. Μultithread can solve that problem, right now everything is running on NB app is 1 thread, if is possible to have multi thread then you can isolate and receive response from the thread if has frozen or not.
I don't know if Dave is planning to add multi threading in NB, so i can't help you with that.

Thanks
User avatar
smartmedia
 
Posts: 889
Joined: Fri Apr 01, 2005 6:50 am
Location: Hellas

Postby Neosoft Support » Mon Jul 11, 2011 10:27 am

There really isn't anything that we can do about the time required by the database engine to transfer large amounts of data to and from the server. This is entirely a function of the database engine and the network used to transfer the data. DBPro has no control over this. It MIGHT be possible to transfer data over the network in the background, but the database would still remain locked for the duration of the transfer.

It sounds like you're trying to place some very large images into the blob field. This can be acceptable when using a database stored on the local hard drive, but it's just not practical when data needs to be stored on a remote server. This would be the same for any client-side database tool because the data must to be transferred over the network to the client machine to be viewed.
NeoSoft Support
Neosoft Support
NeoSoft Team
 
Posts: 5593
Joined: Thu Mar 31, 2005 10:48 pm
Location: Oregon, USA

Postby beno » Mon Jul 11, 2011 11:02 am

Hi,

Perhaps this can be tackled using a different approach:

- The publication can upload the images to the server using NBFileTransfer plugin and later use a server script to update the database.

My cent,

beno
User avatar
beno
 
Posts: 678
Joined: Fri Apr 01, 2005 9:03 am
Location: México

Postby djpilot » Mon Jul 11, 2011 1:17 pm

Hi all, thanks for the very informative replies. I was kind of not wanting to hear the answers but expected it anyway.

I am not too worried that it takes time to upload/download etc, the biggest problem is the fact that there is no feedback from DBPro to indicate that something is actually happening. Even if it could pass something back to a fixedpos window or similar that indicated x% of y% complete would be sufficient. Its the not knowing that causes the biggest trouble.


The application is used by techs connected remotely to the internet using 3G modems to submit maintenance reports. There are several small images that need to be sent. I prevent anything larger than 300kb but even 100kb causes unacceptable delays.

I was really hoping to use NeoBook for this app as I wanted to have the 'Windows' look and feel, plus NeoBook is (and has always been) fantastic for building apps really fast.

Once again, thanks for your thoughts and ideas. Beno, that is an idea I will try to look into.

:D
djpilot
 
Posts: 21
Joined: Sun Jun 19, 2011 8:03 pm

Postby Neosoft Support » Tue Jul 12, 2011 11:03 am

Unfortunately, databases do not provide any type of progress information for us to display while data is being posted. In most cases the amount of data is small and is transferred fast enough that no feedback is necessary. It's not possible to display a progress bar indicating the percentage of data transferred, however, you could display a custom message while data is being posted. For example, you could try something like this:

ShowObject "BusyMsg" "None" "0"
dbpSaveEdits "MyDB" "Sales"
HideObject "BusyMsg" "None" "0"
NeoSoft Support
Neosoft Support
NeoSoft Team
 
Posts: 5593
Joined: Thu Mar 31, 2005 10:48 pm
Location: Oregon, USA


Return to NeoBookDBPro

Who is online

Users browsing this forum: No registered users and 2 guests