Print Thread
"Stream read error" using TLobLocator.SaveToFile
#34530 08/04/09 07:52 PM
Joined: Dec 2005
Posts: 17
A
Member
OP Offline
Member
A
Joined: Dec 2005
Posts: 17
Hi!

I'm using the code bellow to write a LOB to a file. When the file is too big (above 300 Mb), sometimes I receive a "Stream read error" or an "Invalid handle" error. This seems to occour more frequently when my application is being executed on a Windows 2003 Server.

vLobLocator := Qr_SaveCLOB_.LOBField(0);
vLobLocator.Seek(vLobLocator.Size * -1, soFromEnd);
vLobSize := vLobLocator.Size;
if not vLobLocator.IsNull then


Adelson Smania
Mega Sistemas Corporativos
Re: "Stream read error" using TLobLocator.SaveToFile
Adelson Smania #34532 08/05/09 10:04 AM
Joined: Aug 1999
Posts: 22,216
Member
Offline
Member
Joined: Aug 1999
Posts: 22,216
At which line do you get these errors?


Marco Kalter
Allround Automations
Re: "Stream read error" using TLobLocator.SaveToFile
Marco Kalter #34534 08/05/09 11:16 AM
Joined: Dec 2005
Posts: 17
A
Member
OP Offline
Member
A
Joined: Dec 2005
Posts: 17
Hi, Marco!

Each error occours in the following lines:

vLobLocator.Read(vBuffer, 32767) - "Invalid handle"
vLobLocator.SaveToFile(vPathSaida) - "Stream read error"

Thanks.


Adelson Smania
Mega Sistemas Corporativos
Re: "Stream read error" using TLobLocator.SaveToFile
Adelson Smania #34538 08/06/09 10:49 AM
Joined: Aug 1999
Posts: 22,216
Member
Offline
Member
Joined: Aug 1999
Posts: 22,216
Normally this indicates that the TLOBLocator is not properly initialized, but you already check for IsNull, so this should be okay. Can you log the value of TLOBLocator.Size in case of this error?


Marco Kalter
Allround Automations
Re: "Stream read error" using TLobLocator.SaveToFile
Marco Kalter #34575 08/12/09 02:30 PM
Joined: Dec 2005
Posts: 17
A
Member
OP Offline
Member
A
Joined: Dec 2005
Posts: 17
Hi, Marco!

The problem has been solved! It seems there was something to do with the session we were using, shared with other activities in the system.

Now, we are using a dedicated session and everything works fine.

Thanks for your atention!


Adelson Smania
Mega Sistemas Corporativos
Re: "Stream read error" using TLobLocator.SaveToFile
Adelson Smania #34578 08/13/09 09:10 AM
Joined: Aug 1999
Posts: 22,216
Member
Offline
Member
Joined: Aug 1999
Posts: 22,216
Okay, thanks for letting me know.


Marco Kalter
Allround Automations

Moderated by  support 

Link Copied to Clipboard
Powered by UBB.threads™ PHP Forum Software 7.7.4
(Release build 20200307)
Responsive Width:

PHP: 7.1.33 Page Time: 0.031s Queries: 13 (0.007s) Memory: 2.5234 MB (Peak: 3.0456 MB) Data Comp: Off Server Time: 2024-05-11 16:16:15 UTC
Valid HTML 5 and Valid CSS