Subject Re: [Firebird-Java] Blob and FBWrappingDataSource Problems?
Author Rick Fincher
Hi William,

On your connection url string: I seem to remember someone mentioning awhile
back that if the port number is left out that the code assumes 3050,
although I belive the spec calls for the port number to be in there.

That may be why that works. As for why the other address doesn't work, try
using the actual machine name rather than localhost and see if that works.
I'm using that format and it works fine for me.

What OS are you using? Can you ping localhost? I assume yes, since the
address format you are using seems to work for you.

Are you using this in a standalone or with something like Tomcat?

The second part of your mail sounds like it could be a bug in rc1a.

But since you are getting part of the file, it may be that the driver is
timing out, possibly after an initial chunk of data is returned and the
system goes back to the disk drive for more and blocks the process.

Try something like:

fbwds.setBlockingTimeout(10000);

I'm presuming that setBlockingTimeout is the amount of time the driver will
wait on a blocked request from the server. I'm also presuming that the
parameter is in milliseconds. I'm not sure what the default is right off
hand.

Rick

----- Original Message -----
From: "William L. Thomson Jr." <support@...>
To: "Firebird-Java" <Firebird-Java@yahoogroups.com>
Sent: Wednesday, October 02, 2002 6:24 PM
Subject: [Firebird-Java] Blob and FBWrappingDataSource Problems?


> I am experiencing some funkiness while trying to switch from the
> DriverManager.getConnection();
>
> to
>
> FBWrappingDataSource.getConnection();
>
> To begin with I believe the release notes are a little off regarding
> this. The release notes show a url of
>
> fbwds.setDatabaseName("//localhost:3050/dir1/subdir/myDatabase.gdb");
> // an old format version of the same url
> // fbwds.setDatabaseName("localhost/3050:/dir1/subdir/myDatabase.gdb");
>
> Neither of which work, both produce errors and do not connect.
>
> I have found that
>
> fbwds.setDatabaseName("localhost:/dir1/subdir/myDatabase.gdb");
>
> is the only one that works for me. The others work when using
> connections via DriverManager, but not for DataSource connections.
>
> Back to my funky problem. When I use the DriverManager's connection I
> have no problem extracting and displaying jpeg's stored in a blob binary
> format using a servlet.
>
> When I use the exact same servlet, but with a connection returned from
> the FBWrappingDatasource my jpeg is not rendered fully. The image is
> there, but is not clear, and is hard to describe. I assume that only
> part of the data stored is being retrieved, and possible the connection
> is closing or being returned to early?
>
> It's seems strange since the ResultSet, Statement and Connection are all
> closed after the data has been retrieved. Yet I can't figure out why my
> jpegs are not coming out clearly.
>
> I am 99% sure it's not the servlet's fault. It works fine with a
> DriverManger created connection, both with Jaybird and InterClient. When
> I use a FBWrappingDataSource created connection as part of a pool, I get
> funky jpeg's? I can post the servlet's code, but I am pretty sure it has
> nothing to do with the servlet code.
>
> I guess the problem is in how the connection is being created, or
> possible something to do with the pooling aspect of the
> FBWrappingDataSource.
>
> I am a little stumped. Anyone experience anything along these lines?
> Advice?
>
> I am using the RC1a version of Jaybird, and may compile and test the one
> in cvs.
>
> --
> Sincerely,
> William L. Thomson Jr.
> Support Group
> Obsidian-Studios Inc.
> 439 Amber Way
> Petaluma, Ca. 94952
> Phone 707.766.9509
> Fax 707.766.8989
> http://www.obsidian-studios.com

>