Sybase NNTP forums - End Of Life (EOL)

The NNTP forums from Sybase - forums.sybase.com - are now closed.

All new questions should be directed to the appropriate forum at the SAP Community Network (SCN).

Individual products have links to the respective forums on SCN, or you can go to SCN and search for your product in the search box (upper right corner) to find your specific developer center.

governor for prepared statements exceeded

8 posts in General Discussion Last posting was on 2005-05-25 14:40:29.0Z
Tony Posted on 2005-05-23 15:18:00.0Z
Sender: 570c.4291f3cb.1804289383@sybase.com
From: tony
Newsgroups: ianywhere.public.general
Subject: governor for prepared statements exceeded
X-Mailer: WebNews to Mail Gateway v1.1t
Message-ID: <4291f424.5712.1681692777@sybase.com>
X-Original-NNTP-Posting-Host: 10.22.241.42
X-Original-Trace: 23 May 2005 08:17:56 -0700, 10.22.241.42
Lines: 49
X-Original-NNTP-Posting-Host: forums-2-dub.sybase.com
X-Original-Trace: 23 May 2005 08:17:58 -0700, forums-2-dub.sybase.com
NNTP-Posting-Host: forums-master.sybase.com
X-Original-NNTP-Posting-Host: forums-master.sybase.com
Date: 23 May 2005 08:18:00 -0700
X-Trace: forums-1-dub 1116861480 10.22.108.75 (23 May 2005 08:18:00 -0700)
X-Original-Trace: 23 May 2005 08:18:00 -0700, forums-master.sybase.com
X-Authenticated-User: ngsysop
Path: forums-1-dub!not-for-mail
Xref: forums-1-dub ianywhere.public.general:4488
Article PK: 8299

Hello

I'm using ASA 9.0.2 for a PocketPC database solution. I
use .NET for developing.
The error I keep getting is 'governor for prepared statement
excedeed'.
I use only one connection to the database and only one
command(I change its properties from one step to another).
I'll present the relevant code(C#):

this is where the connection is instantiated.

....................................................
_connection = new AsaConnection(_dbConnectionString);
_connection.Open();

....................................................

further I extract data from database like this:

selectString = String.Format(...);

cmd.Cancel();
cmd.CommandText = selectString;
cmd.Connection = Singleton.Connection;
reader = cmd.ExecuteReader();


while(reader.Read())
{
.....
}

reader.Close();

I repeat the step above on and on ...till I get
the error.

Since I don't have simultaneous connection, I wonder where
could be the problem.
It tried with the 'MAX_STATEMENT_COUNT = 0' and
'MAX_CURSOR_COUNT = 0', it didn't work; I found on the net
advices to search for 'statement leaks'. How could these
appear?

I would really need some help.

Thank you


Glenn Paulley Posted on 2005-05-23 20:52:51.0Z
Newsgroups: ianywhere.public.general
Subject: Re: governor for prepared statements exceeded
From: Glenn Paulley <paulley@ianywhere.com>
References: <4291f424.5712.1681692777@sybase.com>
Organization: iAnywhere Solutions
Message-ID: <Xns965FABB70B42Cpaulleyianywherecom@192.138.151.106>
User-Agent: Xnews/5.04.25
NNTP-Posting-Host: cpe0004e24a1297-cm000039260a65.cpe.net.cable.rogers.com
X-Original-NNTP-Posting-Host: cpe0004e24a1297-cm000039260a65.cpe.net.cable.rogers.com
Date: 23 May 2005 13:52:51 -0700
X-Trace: forums-1-dub 1116881571 70.28.240.26 (23 May 2005 13:52:51 -0700)
X-Original-Trace: 23 May 2005 13:52:51 -0700, cpe0004e24a1297-cm000039260a65.cpe.net.cable.rogers.com
Lines: 88
X-Authenticated-User: techsupp
Path: forums-1-dub!not-for-mail
Xref: forums-1-dub ianywhere.public.general:4489
Article PK: 8296

The SQL Anywhere server maintains data structures within the server for
each active PREPARED statement issued by a connection. These structures
are freed only when the application signals to the server that the
statements are no longer needed (or the connection disconnects). This
"signal" corresponds to a DROP STATEMENT request (which is what would be
issued by an embedded SQL program). Once a connection exceeds the value
of MAX_STATEMENT_COUNT (default 50) the governor intervenes and gives an
error. The governor exists to prevent the server from aborting due to an
infinite or semi-infinite leak of such resources. In your case, the .Net
framework you are using is issuing an implicit PREPARE STATEMENT behind
the scenes.

Other interfaces have different API calls to accomplish a DROP STATEMENT.
In Java or C# one should not rely on garbage collection to perform this
cleanup since the language routines do not issue server calls to
deallocate the statement resources, and moreover there is (usually) no
guarantee of when the garbage collection routines will execute.

Glenn

tony wrote in news:4291f424.5712.1681692777@sybase.com:

>
> Hello
>
> I'm using ASA 9.0.2 for a PocketPC database solution. I
> use .NET for developing.
> The error I keep getting is 'governor for prepared statement
> excedeed'.
> I use only one connection to the database and only one
> command(I change its properties from one step to another).
> I'll present the relevant code(C#):
>
> this is where the connection is instantiated.
>
> ....................................................
> _connection = new AsaConnection
(_dbConnectionString);
> _connection.Open();
>
> ....................................................
>
> further I extract data from database like this:
>
> selectString = String.Format(...);
>
> cmd.Cancel();
> cmd.CommandText = selectString;
> cmd.Connection = Singleton.Connection;
> reader = cmd.ExecuteReader();
>
>
> while(reader.Read())
> {
> .....
> }
>
> reader.Close();
>
> I repeat the step above on and on ...till I get
> the error.
>
> Since I don't have simultaneous connection, I wonder where
> could be the problem.
> It tried with the 'MAX_STATEMENT_COUNT = 0' and
> 'MAX_CURSOR_COUNT = 0', it didn't work; I found on the net
> advices to search for 'statement leaks'. How could these
> appear?
>
> I would really need some help.
>
> Thank you
>

--
Glenn Paulley
Research and Development Manager, Query Processing
iAnywhere Solutions Engineering

EBF's and Patches: http://downloads.sybase.com
choose SQL Anywhere Studio >> change 'time frame' to all

To Submit Bug Reports: http://casexpress.sybase.com/cx/cx.stm

SQL Anywhere Studio Supported Platforms and Support Status
http://my.sybase.com/detail?id=1002288


Greg Fenton Posted on 2005-05-24 01:24:43.0Z
From: Greg Fenton <greg.fenton_NOSPAM_@ianywhere.com>
Organization: iAnywhere Solutions Inc.
User-Agent: Mozilla Thunderbird 1.6.3.2f (Windows/20050317)
X-Accept-Language: en-us, en
MIME-Version: 1.0
Newsgroups: ianywhere.public.general
Subject: Re: governor for prepared statements exceeded
References: <4291f424.5712.1681692777@sybase.com>
In-Reply-To: <4291f424.5712.1681692777@sybase.com>
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 7bit
NNTP-Posting-Host: vpn-concord-085.sybase.com
X-Original-NNTP-Posting-Host: vpn-concord-085.sybase.com
Message-ID: <4292825b$1@forums-1-dub>
Date: 23 May 2005 18:24:43 -0700
X-Trace: forums-1-dub 1116897883 158.159.8.85 (23 May 2005 18:24:43 -0700)
X-Original-Trace: 23 May 2005 18:24:43 -0700, vpn-concord-085.sybase.com
Lines: 24
X-Authenticated-User: techsupp
Path: forums-1-dub!not-for-mail
Xref: forums-1-dub ianywhere.public.general:4492
Article PK: 8298


tony wrote:
>
> I'm using ASA 9.0.2 for a PocketPC database solution. I
> use .NET for developing.

Along with Glenn's response, note that AsaConnection by default
implements connection pooling (as per the .NET spec).

In the ASA 9.x online docs, see:

ASA Programming Guide
Adaptive Server Anywhere .NET Data Provider API Reference
AsaConnection class
- ConnectionString property

Hope this helps,
greg.fenton
--
Greg Fenton
Consultant, Solution Services, iAnywhere Solutions
--------
Visit the iAnywhere Solutions Developer Community
Whitepapers, TechDocs, Downloads
http://www.ianywhere.com/developer/


Tony Posted on 2005-05-24 08:20:10.0Z
Sender: 3649.4292d7e1.1804289383@sybase.com
From: tony
Newsgroups: ianywhere.public.general
Subject: Re: governor for prepared statements exceeded
X-Mailer: WebNews to Mail Gateway v1.1t
Message-ID: <4292e3ba.36cc.1681692777@sybase.com>
References: <4292825b$1@forums-1-dub>
NNTP-Posting-Host: 10.22.241.41
X-Original-NNTP-Posting-Host: 10.22.241.41
Date: 24 May 2005 01:20:10 -0700
X-Trace: forums-1-dub 1116922810 10.22.241.41 (24 May 2005 01:20:10 -0700)
X-Original-Trace: 24 May 2005 01:20:10 -0700, 10.22.241.41
Lines: 49
Path: forums-1-dub!not-for-mail
Xref: forums-1-dub ianywhere.public.general:4494
Article PK: 8303

Hello guys,

thank you for your quick responces.

I have looked into the Drop Statement command, but i run
into an other problem.

In the Drop Statement syntax there it is required the

[owner.]statement-name
statement-name : identifier | hostvar

If the statements in .NET are prepared automatically, how
can i get the prepared statement name (the one to use in the
drop statement)?

Eventually can you provide me with a small code example?
Because in the iAnywhere (.NET) product documentation i
could not find something like this.

thank you very much,
tony.

> tony wrote:
> >
> > I'm using ASA 9.0.2 for a PocketPC database solution.
> > I use .NET for developing.
>
> Along with Glenn's response, note that AsaConnection by
> default implements connection pooling (as per the .NET
> spec).
>
> In the ASA 9.x online docs, see:
>
> ASA Programming Guide
> Adaptive Server Anywhere .NET Data Provider API
> Reference
> AsaConnection class
> - ConnectionString property
>
> Hope this helps,
> greg.fenton
> --
> Greg Fenton
> Consultant, Solution Services, iAnywhere Solutions
> --------
> Visit the iAnywhere Solutions Developer Community
> Whitepapers, TechDocs, Downloads
> http://www.ianywhere.com/developer/


Jason Hinsperger (iAnywhere) Posted on 2005-05-24 18:29:43.0Z
From: "Jason Hinsperger \(iAnywhere\)" <NOjason_hinspergerSPAM@hotmail.com>
Newsgroups: ianywhere.public.general
References: <4292825b$1@forums-1-dub> <4292e3ba.36cc.1681692777@sybase.com>
Subject: Re: governor for prepared statements exceeded
Lines: 72
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 6.00.2900.2180
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.2180
X-RFC2646: Format=Flowed; Original
NNTP-Posting-Host: hinsperg-xp.sybase.com
X-Original-NNTP-Posting-Host: hinsperg-xp.sybase.com
Message-ID: <42937297$1@forums-1-dub>
Date: 24 May 2005 11:29:43 -0700
X-Trace: forums-1-dub 1116959383 10.25.99.194 (24 May 2005 11:29:43 -0700)
X-Original-Trace: 24 May 2005 11:29:43 -0700, hinsperg-xp.sybase.com
X-Authenticated-User: techsupp
Path: forums-1-dub!not-for-mail
Xref: forums-1-dub ianywhere.public.general:4504
Article PK: 8312

Calling reader.Close() accomplishes the same thing as dropping the
statement. Are you sure you are calling reader.close at the end of EVERY
iteration through your pseudo-code loop?
Please also verify that the version/build number of your
ianywhere.data.asaclient.dll is 9.0.2.

If this does not help, can you supply a larger code block and describe it?

--
Jason Hinsperger
Product Manager
iAnywhere Solutions
************************************************************
For the latest downloads technotes, whitepapers, webcasts and other
developer
resources, go to: http://www.ianywhere.com/developer/
************************************************************

<tony> wrote in message news:4292e3ba.36cc.1681692777@sybase.com...
> Hello guys,
>
> thank you for your quick responces.
>
> I have looked into the Drop Statement command, but i run
> into an other problem.
>
> In the Drop Statement syntax there it is required the
>
> [owner.]statement-name
> statement-name : identifier | hostvar
>
> If the statements in .NET are prepared automatically, how
> can i get the prepared statement name (the one to use in the
> drop statement)?
>
> Eventually can you provide me with a small code example?
> Because in the iAnywhere (.NET) product documentation i
> could not find something like this.
>
> thank you very much,
> tony.
>
>> tony wrote:
>> >
>> > I'm using ASA 9.0.2 for a PocketPC database solution.
>> > I use .NET for developing.
>>
>> Along with Glenn's response, note that AsaConnection by
>> default implements connection pooling (as per the .NET
>> spec).
>>
>> In the ASA 9.x online docs, see:
>>
>> ASA Programming Guide
>> Adaptive Server Anywhere .NET Data Provider API
>> Reference
>> AsaConnection class
>> - ConnectionString property
>>
>> Hope this helps,
>> greg.fenton
>> --
>> Greg Fenton
>> Consultant, Solution Services, iAnywhere Solutions
>> --------
>> Visit the iAnywhere Solutions Developer Community
>> Whitepapers, TechDocs, Downloads
>> http://www.ianywhere.com/developer/


Tony Posted on 2005-05-25 06:17:37.0Z
Sender: 426a.429413c7.1804289383@sybase.com
From: tony
Newsgroups: ianywhere.public.general
Subject: Re: governor for prepared statements exceeded
X-Mailer: WebNews to Mail Gateway v1.1t
Message-ID: <42941881.4275.1681692777@sybase.com>
References: <42937297$1@forums-1-dub>
NNTP-Posting-Host: 10.22.241.41
X-Original-NNTP-Posting-Host: 10.22.241.41
Date: 24 May 2005 23:17:37 -0700
X-Trace: forums-1-dub 1117001857 10.22.241.41 (24 May 2005 23:17:37 -0700)
X-Original-Trace: 24 May 2005 23:17:37 -0700, 10.22.241.41
Lines: 166
Path: forums-1-dub!not-for-mail
Xref: forums-1-dub ianywhere.public.general:4505
Article PK: 8313

Thank you Jason,

We are using a singleton "DataManager" class which realizes
the connection to the database. This manager encapsulates
all the SQL commands which we issue in the program.
I have checked the full code once again, and after every
AsaCommand.ExecuteReader(), we always close the returned
AsaDataReader.

The functions from the datamanager look like the one below.
I would like to mention that the we have a single
AsaCommand and AsaDataReader object instances which we reuse
in different SQL queries.
We also tried to make different instances of theese objects
(in fact we started the program in this way) but we got the
same result.

This is the code of one function from the DataManager class:

#region GetJobData
/// <summary>
/// Gets the list of active jobs
/// </summary>
/// <returns>an ArrayList of JobData elements</returns>
private ArrayList GetJobData()
{
ArrayList jobList = new ArrayList();

try
{
string selectString =
"SELECT " +
"JOB.JOB_ID, " +
"JOB.JOB_CODE, " +
"JOB.ROO_ID, " +
"JOB.ROT_ID, " +
"JOB.OBJ_ID, " +
"JOB.BUI_ID, " +
"JOB.INT_ID, " +
"JOB.ROO_INV_ID, " +
"JOB.CYC_ID " +
"FROM " +
" JOB_JOB JOB, " +
" JTT_JOBTIMETABLE JTT " +
"WHERE " +
"JOB.JOB_CODE = JTT.JOB_CODE AND " +
"JTT.JTT_NEXTTIME <= getDate() AND " +
"JOB.JOB_ISACTIVE = 1 AND " +
"JTT.JTT_COUNTER = " +
"(select max(JTT_COUNTER) from JTT_JOBTIMETABLE X where
X.JTT_ID = JTT.JTT_ID) " ;

cmd.Cancel();
cmd.CommandText = selectString;
cmd.Connection = DataBaseManager.Instance.Connection;;
reader = cmd.ExecuteReader();

while(reader.Read())
{

JobData jobData = new JobData(
reader.IsDBNull(0) ? 0 : reader.GetInt32(0),
reader.IsDBNull(1) ? "" : reader.GetString(1),
reader.IsDBNull(2) ? 0 : reader.GetInt32(2),
reader.IsDBNull(3) ? 0 : reader.GetInt32(3),
reader.IsDBNull(4) ? 0 : reader.GetInt32(4),
reader.IsDBNull(5) ? 0 : reader.GetInt32(5),
reader.IsDBNull(6) ? 0 : reader.GetInt32(6),
reader.IsDBNull(7) ? 0 : reader.GetInt32(7),
reader.IsDBNull(8) ? 0 : reader.GetInt32(8)
);

jobList.Add(jobData);
}

reader.Close();

return jobList;

}
catch(Exception ex)
{
Log.LogManager.Instance.Error("Exception caught in
GetJobData() " + ex.ToString());
return jobList;
}
}
#endregion

Thank you.

> Calling reader.Close() accomplishes the same thing as
> dropping the statement. Are you sure you are calling
> reader.close at the end of EVERY iteration through your
> pseudo-code loop? Please also verify that the
> version/build number of your ianywhere.data.asaclient.dll
> is 9.0.2.
>
> If this does not help, can you supply a larger code block
> and describe it?
>
> --
> Jason Hinsperger
> Product Manager
> iAnywhere Solutions
> **********************************************************
> ** For the latest downloads technotes, whitepapers,
> webcasts and other developer
> resources, go to: http://www.ianywhere.com/developer/
> **********************************************************
> **
>
>
>
> <tony> wrote in message
> > news:4292e3ba.36cc.1681692777@sybase.com... Hello guys,
> >
> > thank you for your quick responces.
> >
> > I have looked into the Drop Statement command, but i run
> > into an other problem.
> >
> > In the Drop Statement syntax there it is required the
> >
> > [owner.]statement-name
> > statement-name : identifier | hostvar
> >
> > If the statements in .NET are prepared automatically,
> > how can i get the prepared statement name (the one to
> > use in the drop statement)?
> >
> > Eventually can you provide me with a small code example?
> > Because in the iAnywhere (.NET) product documentation i
> > could not find something like this.
> >
> > thank you very much,
> > tony.
> >
> >> tony wrote:
> >> >
> >> > I'm using ASA 9.0.2 for a PocketPC database
> solution. >> > I use .NET for developing.
> >>
> >> Along with Glenn's response, note that AsaConnection by
> >> default implements connection pooling (as per the .NET
> >> spec).
> >>
> >> In the ASA 9.x online docs, see:
> >>
> >> ASA Programming Guide
> >> Adaptive Server Anywhere .NET Data Provider API
> >> Reference
> >> AsaConnection class
> >> - ConnectionString property
> >>
> >> Hope this helps,
> >> greg.fenton
> >> --
> >> Greg Fenton
> >> Consultant, Solution Services, iAnywhere Solutions
> >> --------
> >> Visit the iAnywhere Solutions Developer Community
> >> Whitepapers, TechDocs, Downloads
> >> http://www.ianywhere.com/developer/
>
>


Jason Hinsperger (iAnywhere) Posted on 2005-05-25 14:40:29.0Z
From: "Jason Hinsperger \(iAnywhere\)" <NOjason_hinspergerSPAM@hotmail.com>
Newsgroups: ianywhere.public.general
References: <42937297$1@forums-1-dub> <42941881.4275.1681692777@sybase.com>
Subject: Re: governor for prepared statements exceeded
Lines: 196
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 6.00.2900.2180
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.2180
X-RFC2646: Format=Flowed; Original
NNTP-Posting-Host: hinsperg-xp.sybase.com
X-Original-NNTP-Posting-Host: hinsperg-xp.sybase.com
Message-ID: <42948e5d@forums-1-dub>
Date: 25 May 2005 07:40:29 -0700
X-Trace: forums-1-dub 1117032029 10.25.99.194 (25 May 2005 07:40:29 -0700)
X-Original-Trace: 25 May 2005 07:40:29 -0700, hinsperg-xp.sybase.com
X-Authenticated-User: techsupp
Path: forums-1-dub!not-for-mail
Xref: forums-1-dub ianywhere.public.general:4507
Article PK: 8316

That is odd. Your code looks ok to me. Can you turn on debug ouput on the
database server (using the -zr all switch) and then run your test? Check
the server output to verify that your statements are actually being closed
on the server.

If you are doing this in a development environment, you could step through
your code with the server window visible. When you step over the Close()
call, the server window debug output should display messages stating it is
closing/dropping your statement.
You could also monitor the 'Prepstmt' and 'CursorOpen' connection properties
for your connection in DBISQL, using the sa_conn_properties() stored
procedure.

Let us know what you find.

--
Jason Hinsperger
Product Manager
iAnywhere Solutions
************************************************************
For the latest downloads technotes, whitepapers, webcasts and other
developer
resources, go to: http://www.ianywhere.com/developer/
************************************************************

<tony> wrote in message news:42941881.4275.1681692777@sybase.com...
> Thank you Jason,
>
> We are using a singleton "DataManager" class which realizes
> the connection to the database. This manager encapsulates
> all the SQL commands which we issue in the program.
> I have checked the full code once again, and after every
> AsaCommand.ExecuteReader(), we always close the returned
> AsaDataReader.
>
> The functions from the datamanager look like the one below.
> I would like to mention that the we have a single
> AsaCommand and AsaDataReader object instances which we reuse
> in different SQL queries.
> We also tried to make different instances of theese objects
> (in fact we started the program in this way) but we got the
> same result.
>
> This is the code of one function from the DataManager class:
>
> #region GetJobData
> /// <summary>
> /// Gets the list of active jobs
> /// </summary>
> /// <returns>an ArrayList of JobData elements</returns>
> private ArrayList GetJobData()
> {
> ArrayList jobList = new ArrayList();
>
> try
> {
> string selectString =
> "SELECT " +
> "JOB.JOB_ID, " +
> "JOB.JOB_CODE, " +
> "JOB.ROO_ID, " +
> "JOB.ROT_ID, " +
> "JOB.OBJ_ID, " +
> "JOB.BUI_ID, " +
> "JOB.INT_ID, " +
> "JOB.ROO_INV_ID, " +
> "JOB.CYC_ID " +
> "FROM " +
> " JOB_JOB JOB, " +
> " JTT_JOBTIMETABLE JTT " +
> "WHERE " +
> "JOB.JOB_CODE = JTT.JOB_CODE AND " +
> "JTT.JTT_NEXTTIME <= getDate() AND " +
> "JOB.JOB_ISACTIVE = 1 AND " +
> "JTT.JTT_COUNTER = " +
> "(select max(JTT_COUNTER) from JTT_JOBTIMETABLE X where
> X.JTT_ID = JTT.JTT_ID) " ;
>
> cmd.Cancel();
> cmd.CommandText = selectString;
> cmd.Connection = DataBaseManager.Instance.Connection;;
> reader = cmd.ExecuteReader();
>
> while(reader.Read())
> {
>
> JobData jobData = new JobData(
> reader.IsDBNull(0) ? 0 : reader.GetInt32(0),
> reader.IsDBNull(1) ? "" : reader.GetString(1),
> reader.IsDBNull(2) ? 0 : reader.GetInt32(2),
> reader.IsDBNull(3) ? 0 : reader.GetInt32(3),
> reader.IsDBNull(4) ? 0 : reader.GetInt32(4),
> reader.IsDBNull(5) ? 0 : reader.GetInt32(5),
> reader.IsDBNull(6) ? 0 : reader.GetInt32(6),
> reader.IsDBNull(7) ? 0 : reader.GetInt32(7),
> reader.IsDBNull(8) ? 0 : reader.GetInt32(8)
> );
>
> jobList.Add(jobData);
> }
>
> reader.Close();
>
> return jobList;
>
> }
> catch(Exception ex)
> {
> Log.LogManager.Instance.Error("Exception caught in
> GetJobData() " + ex.ToString());
> return jobList;
> }
> }
> #endregion
>
> Thank you.
>
>> Calling reader.Close() accomplishes the same thing as
>> dropping the statement. Are you sure you are calling
>> reader.close at the end of EVERY iteration through your
>> pseudo-code loop? Please also verify that the
>> version/build number of your ianywhere.data.asaclient.dll
>> is 9.0.2.
>>
>> If this does not help, can you supply a larger code block
>> and describe it?
>>
>> --
>> Jason Hinsperger
>> Product Manager
>> iAnywhere Solutions
>> **********************************************************
>> ** For the latest downloads technotes, whitepapers,
>> webcasts and other developer
>> resources, go to: http://www.ianywhere.com/developer/
>> **********************************************************
>> **
>>
>>
>>
>> <tony> wrote in message
>> > news:4292e3ba.36cc.1681692777@sybase.com... Hello guys,
>> >
>> > thank you for your quick responces.
>> >
>> > I have looked into the Drop Statement command, but i run
>> > into an other problem.
>> >
>> > In the Drop Statement syntax there it is required the
>> >
>> > [owner.]statement-name
>> > statement-name : identifier | hostvar
>> >
>> > If the statements in .NET are prepared automatically,
>> > how can i get the prepared statement name (the one to
>> > use in the drop statement)?
>> >
>> > Eventually can you provide me with a small code example?
>> > Because in the iAnywhere (.NET) product documentation i
>> > could not find something like this.
>> >
>> > thank you very much,
>> > tony.
>> >
>> >> tony wrote:
>> >> >
>> >> > I'm using ASA 9.0.2 for a PocketPC database
>> solution. >> > I use .NET for developing.
>> >>
>> >> Along with Glenn's response, note that AsaConnection by
>> >> default implements connection pooling (as per the .NET
>> >> spec).
>> >>
>> >> In the ASA 9.x online docs, see:
>> >>
>> >> ASA Programming Guide
>> >> Adaptive Server Anywhere .NET Data Provider API
>> >> Reference
>> >> AsaConnection class
>> >> - ConnectionString property
>> >>
>> >> Hope this helps,
>> >> greg.fenton
>> >> --
>> >> Greg Fenton
>> >> Consultant, Solution Services, iAnywhere Solutions
>> >> --------
>> >> Visit the iAnywhere Solutions Developer Community
>> >> Whitepapers, TechDocs, Downloads
>> >> http://www.ianywhere.com/developer/
>>
>>


Chris Keating (iAnywhere Solutions) Posted on 2005-05-25 12:38:33.0Z
From: "Chris Keating \(iAnywhere Solutions\)" <Spam_NoThanks_keating@iAnywhere.com>
Newsgroups: ianywhere.public.general
References: <4291f424.5712.1681692777@sybase.com>
Subject: Re: governor for prepared statements exceeded
Lines: 55
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 6.00.2900.2180
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.2180
X-RFC2646: Format=Flowed; Original
X-Original-NNTP-Posting-Host: keating-xp2.sybase.com
Message-ID: <429471c5$1@forums-2-dub>
X-Original-Trace: 25 May 2005 05:38:29 -0700, keating-xp2.sybase.com
X-Original-NNTP-Posting-Host: forums-2-dub.sybase.com
X-Original-Trace: 25 May 2005 05:38:32 -0700, forums-2-dub.sybase.com
NNTP-Posting-Host: forums-master.sybase.com
X-Original-NNTP-Posting-Host: forums-master.sybase.com
Date: 25 May 2005 05:38:33 -0700
X-Trace: forums-1-dub 1117024713 10.22.108.75 (25 May 2005 05:38:33 -0700)
X-Original-Trace: 25 May 2005 05:38:33 -0700, forums-master.sybase.com
X-Authenticated-User: ngsysop
Path: forums-1-dub!not-for-mail
Xref: forums-1-dub ianywhere.public.general:4506
Article PK: 8315

Invoke the Dispose method to clear up resources allocated.

<tony> wrote in message news:4291f424.5712.1681692777@sybase.com...
>
> Hello
>
> I'm using ASA 9.0.2 for a PocketPC database solution. I
> use .NET for developing.
> The error I keep getting is 'governor for prepared statement
> excedeed'.
> I use only one connection to the database and only one
> command(I change its properties from one step to another).
> I'll present the relevant code(C#):
>
> this is where the connection is instantiated.
>
> ....................................................
> _connection = new AsaConnection(_dbConnectionString);
> _connection.Open();
>
> ....................................................
>
> further I extract data from database like this:
>
> selectString = String.Format(...);
>
> cmd.Cancel();
> cmd.CommandText = selectString;
> cmd.Connection = Singleton.Connection;
> reader = cmd.ExecuteReader();
>
>
> while(reader.Read())
> {
> .....
> }
>
> reader.Close();
>
> I repeat the step above on and on ...till I get
> the error.
>
> Since I don't have simultaneous connection, I wonder where
> could be the problem.
> It tried with the 'MAX_STATEMENT_COUNT = 0' and
> 'MAX_CURSOR_COUNT = 0', it didn't work; I found on the net
> advices to search for 'statement leaks'. How could these
> appear?
>
> I would really need some help.
>
> Thank you