I've got an apache server using FreeTDS, DBI & DBD::Sybase to connect to a sql2008 db. I would like to implement sql2008's Filestream functionality, but I've hit a wall.
#$print is postscript content generated with Postscript::Simple
my $statement ="insert into Printed (thisid,[datetime],id,printedby,da
values ('$thisid','$now','$id','$userid',cast('$print' as varbinary(MA
warn "Aborted because $@";
Yes, I'm actually printing the content to a physical printer, but I need to store a "snapshot" of the print job for auditing purposes since the information is sensitive. If I set $print to a simple test string (i.e. 'testing'), it works like a charm and I can see the text files on the sql server. However, when I try to set $print to my postscript content, I get the following error in the apache log:
[Mon Feb 28 17:54:25 2011] -e: DBD::Sybase::db do failed: Server messa
+ge number=8179 severity=16 state=2 line=1 server=SQL2008\SQL2008 proc
+edure=sp_unprepare text=Could not find prepared statement with handle
[Mon Feb 28 17:54:25 2011] -e: Aborted because DBD::Sybase::db do fail
+ed: Server message number=8179 severity=16 state=2 line=1 server=SQL2
+008\SQL2008 procedure=sp_unprepare text=Could not find prepared state
+ment with handle 0.
...and then after restarting apache, I see:
[Tue Mar 01 10:39:20 2011] [notice] Graceful restart requested, doing
out of memory for rpc row!
...Which I only see after running my script with ps content and restarting apache. No other time.
I haven't been able to find much help from google, but I'm suspecting that the FreeTDS connection is getting overloaded by the volume of the content I'm trying to pass (???), however, sql2008 Filestream is designed for files larger than 1M. Anything smaller is defeating the purpose. Is it even possible to implement Filestream with perl scripts?