You are viewing a plain text version of this content. The canonical link for it is here.
Posted to derby-user@db.apache.org by Ha...@gmx.de on 2005/11/12 19:33:23 UTC

SqlException: Run out of sections to use

Hallo,

I'm new to Derby and try to port a java app from MySQL to Derby. When I try
to insert several 1000 rows I get the following SqlException:
Run out of sections to use,sections limited to 32k currently

After every 100 inserts I perform a commit.
I found no hint in the documentation about his problem and also google
didn't help. 
Derby runs as server with default settings and the client connects via
derbyclient.jar. 

Thanks for help,
Harrus

-- 
Lust, ein paar Euro nebenbei zu verdienen? Ohne Kosten, ohne Risiko!
Satte Provisionen f�r GMX Partner: http://www.gmx.net/de/go/partner

Re: SqlException: Run out of sections to use

Posted by Kathey Marsden <km...@sbcglobal.net>.
Dyre.Tjeldvoll@Sun.COM wrote:

>Harrus@gmx.de writes:
>
>  
>
>>Here is the client's stack trace. I have none on the server.
>>org.apache.derby.client.am.SqlException: Run out of sections to use,sections
>>limited to 32k currently
>>	at org.apache.derby.client.am.SectionManager.getSection(Unknown Source)
>>	at org.apache.derby.client.am.SectionManager.getDynamicSection(Unknown
>>Source)
>>	at org.apache.derby.client.am.Statement.flowExecute(Unknown Source)
>>	at org.apache.derby.client.am.Statement.executeUpdateX(Unknown Source)
>>	at org.apache.derby.client.am.Statement.executeUpdate(Unknown Source)
>>
>>The exception occurs after the insert of ~1600 rows in table a and ~23000
>>rows in table b. Each row in table a leads an insert of ~15 rows in table b.
>>After 100 rows in table a and therefore ~1500 rows in table b I call
>>Connection.commit(). I can query the db after the exception occured and it
>>seems that all the commited entries are ok.
>>I can compile the derby sources to get a stack trace with line numbers it it
>>would help.
>>    
>>
>
>  
>

Each section corresponds to a Statement so this would mean that you have
more than 32 thousand statements open.  Unless that is your intention,
you are probably encountering  DERBY-210  which means that you need to
be careful to close all your statements and prepared statements.  They
won't just get garbage collected.   See information on the workaround
and how to  check what statements are open on the server in the comments
for DERBY-210. http://issues.apache.org/jira/browse/DERBY-210.

Also, if you are using Statements for your inserts,  you may want to 
consider using PreparedStatements with dynamic markers('?') instead  for
improved performance and memory usage..
http://db.apache.org/derby/faq.html#derby_faster


Thanks

Kathey






Re: SqlException: Run out of sections to use

Posted by Dy...@Sun.COM.
Harrus@gmx.de writes:

> Here is the client's stack trace. I have none on the server.
> org.apache.derby.client.am.SqlException: Run out of sections to use,sections
> limited to 32k currently
> 	at org.apache.derby.client.am.SectionManager.getSection(Unknown Source)
> 	at org.apache.derby.client.am.SectionManager.getDynamicSection(Unknown
> Source)
> 	at org.apache.derby.client.am.Statement.flowExecute(Unknown Source)
> 	at org.apache.derby.client.am.Statement.executeUpdateX(Unknown Source)
> 	at org.apache.derby.client.am.Statement.executeUpdate(Unknown Source)
>
> The exception occurs after the insert of ~1600 rows in table a and ~23000
> rows in table b. Each row in table a leads an insert of ~15 rows in table b.
> After 100 rows in table a and therefore ~1500 rows in table b I call
> Connection.commit(). I can query the db after the exception occured and it
> seems that all the commited entries are ok.
> I can compile the derby sources to get a stack trace with line numbers it it
> would help.

It looks to me like you are experiencing a DRDA-related problem (the
communication protocol between the server and the client). But I don't
know what would cause your client to exceed the "Section" limit. In
fact I have no idea what a section is, so I hope one of the DRDA
experts can take a look at your post. 

-- 
dt

However, experience shows that for many people and many applications a
dose of paranoia is reasonable - Bjarne Stroustrup


Re: SqlException: Run out of sections to use

Posted by Ha...@gmx.de.
Here is the client's stack trace. I have none on the server.
org.apache.derby.client.am.SqlException: Run out of sections to use,sections
limited to 32k currently
	at org.apache.derby.client.am.SectionManager.getSection(Unknown Source)
	at org.apache.derby.client.am.SectionManager.getDynamicSection(Unknown
Source)
	at org.apache.derby.client.am.Statement.flowExecute(Unknown Source)
	at org.apache.derby.client.am.Statement.executeUpdateX(Unknown Source)
	at org.apache.derby.client.am.Statement.executeUpdate(Unknown Source)

The exception occurs after the insert of ~1600 rows in table a and ~23000
rows in table b. Each row in table a leads an insert of ~15 rows in table b.
After 100 rows in table a and therefore ~1500 rows in table b I call
Connection.commit(). I can query the db after the exception occured and it
seems that all the commited entries are ok.
I can compile the derby sources to get a stack trace with line numbers it it
would help.

Thanks,
Harrus
 
> --- Ursprüngliche Nachricht ---
> Von: Dyre.Tjeldvoll@Sun.COM
> An: Derby Discussion <de...@db.apache.org>
> Betreff: Re: SqlException: Run out of sections to use
> Datum: Sat, 12 Nov 2005 19:53:23 +0100
> 
> Harrus@gmx.de writes:
> 
> > Hallo,
> >
> > I'm new to Derby and try to port a java app from MySQL to Derby. When I
> try
> > to insert several 1000 rows I get the following SqlException:
> > Run out of sections to use,sections limited to 32k currently
> 
> How many is "several"? 
> >
> > After every 100 inserts I perform a commit.
> 
> Hmm, that should not be a problem... how large is each row?
> 
> > I found no hint in the documentation about his problem and also google
> > didn't help. 
> 
> > Derby runs as server with default settings and the client connects via
> > derbyclient.jar. 
> 
> Could you possibly post a complete stack trace? Preferably from
> derby.log if it happens on the server...
> 
> -- 
> dt
> 
> 

-- 
Telefonieren Sie schon oder sparen Sie noch?
NEU: GMX Phone_Flat http://www.gmx.net/de/go/telefonie

Re: SqlException: Run out of sections to use

Posted by Dy...@Sun.COM.
Harrus@gmx.de writes:

> Hallo,
>
> I'm new to Derby and try to port a java app from MySQL to Derby. When I try
> to insert several 1000 rows I get the following SqlException:
> Run out of sections to use,sections limited to 32k currently

How many is "several"? 
>
> After every 100 inserts I perform a commit.

Hmm, that should not be a problem... how large is each row?

> I found no hint in the documentation about his problem and also google
> didn't help. 

> Derby runs as server with default settings and the client connects via
> derbyclient.jar. 

Could you possibly post a complete stack trace? Preferably from
derby.log if it happens on the server...

-- 
dt