Hi Monks!

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.

sub printTransaction{ ... #$print is postscript content generated with Postscript::Simple my $statement ="insert into Printed (thisid,[datetime],id,printedby,da +ta) values ('$thisid','$now','$id','$userid',cast('$print' as varbinary(MA +X)))"; eval{ $db->do($statement); }; if ($@){ warn "Aborted because $@"; $db->rollback; return 0; } ... }
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 + 0. [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 +restart 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?


In reply to sql2008 Filestream by ksublondie

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.