Trouble storing data in a Media dataprovider

I have been struggling with a problem. I am trying to store some .pdf files inside of my servoy database. In my test I drag and drop 3 MB files into an imagemedia field (very cool). This works fine until I have created about 10 rows. At this point Servoy Developer (Version 1.2, Windows, Firebird Backend) freezes up and gives me the message:

“java.lang.NullPointerException null”

I have tried accessing the same data with a different form. I have deleted the column that contains the data and started over only to have the same problem when I get to about the 10th record? Any ideas?

A related question. Does it matter what I set the length to when creating a media dataprovider? I played with this, but still had the same problem.

John McCann

I didn’t get a reply so I will try to ask a more specific question. I am still having trouble storing BLOBS in media files. I am running Servoy developer 1.2 on Window XP with a 2.4 GHz processor and with a Firebird back end and 30 GB of free hard drive. I made a table with two columns. One column is the primary key and the second a media column.

I made two forms. One is a form view with the media field on it. The second form is a list view with the primary key field on it. I dragged and dropped a 3 MB PDF file (The Servoy Developer Guide) to the media field on the form view. I then duplicated this form 4 times. I waited for the data to stop storing and switched to the list view. Everything OK so far. I went back to the form view and duplicated the record 40 times and switched back to the list view. I get the error message:

Could not load record.
Details: java.lang.NullPointerException null

I had a similiar (worse) problem when loading 3 MB JPEG images. Unlike the PDF files which load/duplicate in about 1 second the JPEG images take about 40 seconds to load and duplicate. After duplicating only a few records I get:

Could not load record.
Details: java.lang.NullPointerException null

we will check this out.

I have improved the loading of images (speed and memory usuage)
So please test this in the next beta release of 2.0

Johan

The improvements you made helped allot. However, I still get the problem when I try to load many rows that contain large BLOBS even when the BLOBS are not displayed on the form. I worked around this by putting the information about the BLOBS that I want to display in one table and the actual BLOBS in a related table. I display the information about the BLOBS in my portal or list view table. Under this situation Servoy does not attempt to load the BLOB until I request that the BLOB is displayed. It is really very quick and very stable with this small change.

Thanks

John McCann

I have the same problem.
in one blob there is 7mb pdf file.
I have the blob not visible, but it almost waits for 3 or 4 seconds, before the record is showed.

Can this be fixed?

Are you using Servoy 2.0?

(Sorry: that message was from me!)
Yep, I am using servoy 2.0b5

Please try it:
create some records en put some big (pdf) files in the blob
make a table-view, but don’t show the blob itself, only the primary-key for example.

Than you see, that if you got to browse-mode, servoy waits a few seconds and is loading data. (even when the blob is not showed!)

Hey, this seems to me as comparable to my (reported) issue with printing (even small) image media…

We investigated this issue and it seems that the (firebird) dbdriver already is getting the blob from the database even if we dont get the column from the dbcursor. (we will futher investigate if we can prevent the select at all).
Note: this only does effect the developer and server which talk to the db, the Servoy client will never have this problem.