Re: mssql_execute(): stored procedure execution failed

Robert Gonzalez <[email protected]>
Newsgroups gmane.comp.db.tds.freetds
Message-ID <[email protected]>
I was just playing around with some stuff on my local development system and
ran into your exact problem. The fix for it is dead simple, bit will still
probably require you to modify your existing code in some capacity.

The fix is to free your result resources before sending another init request
to the server. I think you are running into something that has been causing
issues for a while, most recently in PDO as an unbuffered query error. What
is happening is the server is sending back a result but the response is
being held open on it until the next direct query is sent. But since you are
not sending a query and rather sending an init call the server is choking on
the request.

After every one of your queries and subsequent result reads, try adding in a
call to mssql_free_result($yourResultVar). That should make your problem go
away. At least it did for me in my testing just now.

On Fri, May 28, 2010 at 5:29 AM, Sylvain Viart - Gmail <
[email protected]> wrote:

> Hi Robert,
>
> On 27/05/2010 19:38, Robert Gonzalez wrote:
> > Context change messages are severity level 10. I usually set my severity
> > level to 16 (anything higher and you are shutting up real messages - 1-16
> > are status messages).
> >
> > If you changed your severity levels to 16 and you still get that notice
> then
> > I have to suspect that PHP is not reading your ini file properly. Are you
> > changing it in the ini, or with a call to
> > mssql_min_error_severity()/mssql_min_message_severity()?
>
> Was set by php.ini, and seen in phpinfo() after apache restart. :-\
> I've retried.
>
> phpinfo() :
> > mssql
> > MSSQL Support    enabled
> > Active Persistent Links     1
> > Active Links     1
> > Library version     FreeTDS
> >
> > Directive    Local Value    Master Value
> > mssql.allow_persistent    On    On
> > mssql.batchsize    0    0
> > mssql.charset    UTF-8    UTF-8
> > mssql.compatability_mode    Off    Off
> > mssql.connect_timeout    5    5
> > mssql.datetimeconvert    On    On
> > mssql.max_links    Unlimited    Unlimited
> > mssql.max_persistent    Unlimited    Unlimited
> > mssql.max_procs    Unlimited    Unlimited
> > mssql.min_error_severity    17    17
> > mssql.min_message_severity    17    17
> > mssql.secure_connection    Off    Off
> > mssql.textlimit    Server default    Server default
> > mssql.textsize    67108864    67108864
> > mssql.timeout    60    60
>
> here is the output
>
> 2010/05/28 14:10:53 read_msg.php:46:linsyn_priv_get:Changed database
> context to 'D2_master'. /read_msg.php
>
> and logged that way :
> $ps = mssql_init("linsyn_priv_get");
> if(!$ps)
> {
>     my_log("read_msg.php:46:linsyn_priv_get:". mssql_get_last_message());
> }
>
> We doesn't have an error message here.
>
> We have found that the mssql_query('EXEC') never fail.
> We'll need to rewrite more that 700 call by website, (sic).
>
> Legacy code, my love...
>
> I'm still interesting to find a way to debug this error.
>
> Regards,
> Sylvain.
> _______________________________________________
> FreeTDS mailing list
> [email protected]
> http://lists.ibiblio.org/mailman/listinfo/freetds
>



-- 
Robert Gonzalez
http://www.robert-gonzalez.com
http://twitter.com/RobertGonzalez
http://www.linkedin.com/in/robertanthonygonzalez
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.