You are viewing a plain text version of this content. The canonical link for it is here.
Posted to torque-user@db.apache.org by Peter Courcoux <pe...@courcoux.biz> on 2003/08/18 11:37:15 UTC

Village - NegativeArraySizeException

Hi all,

Two Questions :

1.

Has anyone seen anything like this before or have any clues what it
means?

I am using Torque from cvs (yesterday)
Turbine 2.3-dev
Village-2.0-dev-20030625
Postgresql 7.3.3 and postgresql 7.3.3 jdbc jar.


2003-08-18 10:04:17,643 [Ajp13Processor[8009][4]] ERROR com.mydomain.myproject.modules.actions.MyAction - doUpdate() : Exception caught
java.lang.NegativeArraySizeException
	at org.postgresql.jdbc1.AbstractJdbc1Statement.setBinaryStream(AbstractJdbc1Statement.java:1257)
	at com.workingdogs.village.Value.setPreparedStatementValue(Unknown Source)
	at com.workingdogs.village.Record.saveWithUpdate(Unknown Source)
	at com.workingdogs.village.Record.save(Unknown Source)
	at com.workingdogs.village.Record.save(Unknown Source)
	at org.apache.torque.util.BasePeer.insertOrUpdateRecord(BasePeer.java:896)
	at org.apache.torque.util.BasePeer.doUpdate(BasePeer.java:1928)

2.

Also, I posted a question a while ago about booleanchar handling not working in 
postgresql to which I have not had any answer and cannot see anything in the lists.
I am sure I must have not configured things properly since upgrading to recent 
versions of torque. For my project which is upgraded from earlier versions, 
the generator now does not generate code in the populateObject method of BaseXXXPeer,
to handle 'Y' and 'N' and convert to boolean values. It used to work fine but I am 
having to code these bits by hand at the moment.

Does anyone know if I am missing some setting, or otherwise doing something daft?

I would be most grateful for any pointers on either question.

Many thanks,

Peter    

-- 
Peter Courcoux <pe...@courcoux.biz>

---------------------------------------------------------------------
To unsubscribe, e-mail: torque-user-unsubscribe@db.apache.org
For additional commands, e-mail: torque-user-help@db.apache.org


Re: Village - NegativeArraySizeException

Posted by Peter Courcoux <pe...@courcoux.biz>.
Hi Eric,

On Mon, 2003-08-18 at 20:38, Eric Emminger wrote:
> Peter
> 
> >>I am calling save on an object from the following table :-
> >>
> >>  <table idMethod="native" name="name">
> >>    <column name="id" primaryKey="true" required="true" type="BIGINT"/>
> >>    <column name="projectid" type="BIGINT"/>
> >>    <column name="title" size="255" type="VARCHAR"/>
> >>    <column name="status" size="255" type="VARCHAR"/>
> >>    <column name="released" type="BOOLEANCHAR"/>
> >>    <column name="open" type="TIMESTAMP"/>
> >>    <column name="closed" type="TIMESTAMP"/>
> >>    <column name="reference" size="255" type="VARCHAR"/>
> >>    <column name="summary" type="LONGVARCHAR"/>
> >>    <column name="wcategory" size="255" type="VARCHAR"/>
> >>    <column name="valuerange" type="BIGINT"/>
> >>    <column name="location" type="BIGINT"/>
> >>    <column name="accesslistno" type="BIGINT"/>
> >>    <column name="notes" type="LONGVARCHAR"/>
> >>    <column name="useapprlist" type="BOOLEANCHAR"/>
> >>    <column name="listing" size="255" type="VARCHAR"/>
> >>    <column description="Flag to enable bid handling"
> >>      name="enablebidhandling" type="BOOLEANCHAR"/>
> >>    <column description="xml fragment giving policy"
> >>      name="policy" type="CLOB"/>
> >>    <column name="createdat" type="TIMESTAMP"/>
> >>    <column name="modifiedat" type="TIMESTAMP"/>
> >>    <column name="tclass" type="BIGINT"/>
> >>  </table>
> >>
> > I am not using any arrays. Since my original post, I have discovered
> > that this error occurs when I try to save an incomplete record, not sure
> > which field is causing the error, but I'm not sure that it should throw
> > an error like this anyway.
> 
> Interesting. I believe the "policy" field is causing the error. The 
> org.postgresql.jdbc1.AbstractJdbc1Statement.setBinaryStream(AbstractJdbc1Statement.java:1257) 
> method is a Large OBject (LOB) thing, and policy is a CLOB.
> 
According to some logging code inserted into village it is the
LONGVARCHAR fields that are causing the problem when they are null. The
empty CLOB is not causing a problem. Now I have to work out why? ...

Regards,

Peter

> Eric
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: torque-user-unsubscribe@db.apache.org
> For additional commands, e-mail: torque-user-help@db.apache.org
-- 
Peter Courcoux <pe...@courcoux.biz>

---------------------------------------------------------------------
To unsubscribe, e-mail: torque-user-unsubscribe@db.apache.org
For additional commands, e-mail: torque-user-help@db.apache.org


Re: Village - NegativeArraySizeException

Posted by Eric Emminger <er...@ericemminger.com>.
Peter

>>I am calling save on an object from the following table :-
>>
>>  <table idMethod="native" name="name">
>>    <column name="id" primaryKey="true" required="true" type="BIGINT"/>
>>    <column name="projectid" type="BIGINT"/>
>>    <column name="title" size="255" type="VARCHAR"/>
>>    <column name="status" size="255" type="VARCHAR"/>
>>    <column name="released" type="BOOLEANCHAR"/>
>>    <column name="open" type="TIMESTAMP"/>
>>    <column name="closed" type="TIMESTAMP"/>
>>    <column name="reference" size="255" type="VARCHAR"/>
>>    <column name="summary" type="LONGVARCHAR"/>
>>    <column name="wcategory" size="255" type="VARCHAR"/>
>>    <column name="valuerange" type="BIGINT"/>
>>    <column name="location" type="BIGINT"/>
>>    <column name="accesslistno" type="BIGINT"/>
>>    <column name="notes" type="LONGVARCHAR"/>
>>    <column name="useapprlist" type="BOOLEANCHAR"/>
>>    <column name="listing" size="255" type="VARCHAR"/>
>>    <column description="Flag to enable bid handling"
>>      name="enablebidhandling" type="BOOLEANCHAR"/>
>>    <column description="xml fragment giving policy"
>>      name="policy" type="CLOB"/>
>>    <column name="createdat" type="TIMESTAMP"/>
>>    <column name="modifiedat" type="TIMESTAMP"/>
>>    <column name="tclass" type="BIGINT"/>
>>  </table>
>>
> I am not using any arrays. Since my original post, I have discovered
> that this error occurs when I try to save an incomplete record, not sure
> which field is causing the error, but I'm not sure that it should throw
> an error like this anyway.

Interesting. I believe the "policy" field is causing the error. The 
org.postgresql.jdbc1.AbstractJdbc1Statement.setBinaryStream(AbstractJdbc1Statement.java:1257) 
method is a Large OBject (LOB) thing, and policy is a CLOB.

Eric


---------------------------------------------------------------------
To unsubscribe, e-mail: torque-user-unsubscribe@db.apache.org
For additional commands, e-mail: torque-user-help@db.apache.org


Re: Village - NegativeArraySizeException

Posted by Peter Courcoux <pe...@courcoux.biz>.
Eric,

Sorry, I got interrupted and 'send' got hit by mistake.

 

On Mon, 2003-08-18 at 20:10, Peter Courcoux wrote:
> Eric,
> 
> Thanks for looking at this.
> 
> I am calling save on an object from the following table :-
> 
>   <table idMethod="native" name="name">
>     <column name="id" primaryKey="true" required="true" type="BIGINT"/>
>     <column name="projectid" type="BIGINT"/>
>     <column name="title" size="255" type="VARCHAR"/>
>     <column name="status" size="255" type="VARCHAR"/>
>     <column name="released" type="BOOLEANCHAR"/>
>     <column name="open" type="TIMESTAMP"/>
>     <column name="closed" type="TIMESTAMP"/>
>     <column name="reference" size="255" type="VARCHAR"/>
>     <column name="summary" type="LONGVARCHAR"/>
>     <column name="wcategory" size="255" type="VARCHAR"/>
>     <column name="valuerange" type="BIGINT"/>
>     <column name="location" type="BIGINT"/>
>     <column name="accesslistno" type="BIGINT"/>
>     <column name="notes" type="LONGVARCHAR"/>
>     <column name="useapprlist" type="BOOLEANCHAR"/>
>     <column name="listing" size="255" type="VARCHAR"/>
>     <column description="Flag to enable bid handling"
>       name="enablebidhandling" type="BOOLEANCHAR"/>
>     <column description="xml fragment giving policy"
>       name="policy" type="CLOB"/>
>     <column name="createdat" type="TIMESTAMP"/>
>     <column name="modifiedat" type="TIMESTAMP"/>
>     <column name="tclass" type="BIGINT"/>
>   </table>
> 
I am not using any arrays. Since my original post, I have discovered
that this error occurs when I try to save an incomplete record, not sure
which field is causing the error, but I'm not sure that it should throw
an error like this anyway.

I have now made sure only complete records are saved and all is OK so
please do not spend too much valuable time on this but it would be nice
to dig into one day ...

Thanks again.

Regards,

Peter



> 
> On Mon, 2003-08-18 at 20:01, Eric Emminger wrote:
> > Peter
> > 
> > > 2003-08-18 10:04:17,643 [Ajp13Processor[8009][4]] ERROR com.mydomain.myproject.modules.actions.MyAction - doUpdate() : Exception caught
> > > java.lang.NegativeArraySizeException
> > > 	at org.postgresql.jdbc1.AbstractJdbc1Statement.setBinaryStream(AbstractJdbc1Statement.java:1257)
> > > 	at com.workingdogs.village.Value.setPreparedStatementValue(Unknown Source)
> > > 	at com.workingdogs.village.Record.saveWithUpdate(Unknown Source)
> > > 	at com.workingdogs.village.Record.save(Unknown Source)
> > > 	at com.workingdogs.village.Record.save(Unknown Source)
> > > 	at org.apache.torque.util.BasePeer.insertOrUpdateRecord(BasePeer.java:896)
> > > 	at org.apache.torque.util.BasePeer.doUpdate(BasePeer.java:1928)
> > 
> > Have you tried checking the size of the array before using it? Are you 
> > getting any exceptions specific to your code?
> > 
> > Eric
> > 
> > 
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: torque-user-unsubscribe@db.apache.org
> > For additional commands, e-mail: torque-user-help@db.apache.org
-- 
Peter Courcoux <pe...@courcoux.biz>

---------------------------------------------------------------------
To unsubscribe, e-mail: torque-user-unsubscribe@db.apache.org
For additional commands, e-mail: torque-user-help@db.apache.org


Re: Village - NegativeArraySizeException

Posted by Peter Courcoux <pe...@courcoux.biz>.
Eric,

Thanks for looking at this.

I am calling save on an object from the following table :-

  <table idMethod="native" name="name">
    <column name="id" primaryKey="true" required="true" type="BIGINT"/>
    <column name="projectid" type="BIGINT"/>
    <column name="title" size="255" type="VARCHAR"/>
    <column name="status" size="255" type="VARCHAR"/>
    <column name="released" type="BOOLEANCHAR"/>
    <column name="open" type="TIMESTAMP"/>
    <column name="closed" type="TIMESTAMP"/>
    <column name="reference" size="255" type="VARCHAR"/>
    <column name="summary" type="LONGVARCHAR"/>
    <column name="wcategory" size="255" type="VARCHAR"/>
    <column name="valuerange" type="BIGINT"/>
    <column name="location" type="BIGINT"/>
    <column name="accesslistno" type="BIGINT"/>
    <column name="notes" type="LONGVARCHAR"/>
    <column name="useapprlist" type="BOOLEANCHAR"/>
    <column name="listing" size="255" type="VARCHAR"/>
    <column description="Flag to enable bid handling"
      name="enablebidhandling" type="BOOLEANCHAR"/>
    <column description="xml fragment giving policy"
      name="policy" type="CLOB"/>
    <column name="createdat" type="TIMESTAMP"/>
    <column name="modifiedat" type="TIMESTAMP"/>
    <column name="tclass" type="BIGINT"/>
  </table>


On Mon, 2003-08-18 at 20:01, Eric Emminger wrote:
> Peter
> 
> > 2003-08-18 10:04:17,643 [Ajp13Processor[8009][4]] ERROR com.mydomain.myproject.modules.actions.MyAction - doUpdate() : Exception caught
> > java.lang.NegativeArraySizeException
> > 	at org.postgresql.jdbc1.AbstractJdbc1Statement.setBinaryStream(AbstractJdbc1Statement.java:1257)
> > 	at com.workingdogs.village.Value.setPreparedStatementValue(Unknown Source)
> > 	at com.workingdogs.village.Record.saveWithUpdate(Unknown Source)
> > 	at com.workingdogs.village.Record.save(Unknown Source)
> > 	at com.workingdogs.village.Record.save(Unknown Source)
> > 	at org.apache.torque.util.BasePeer.insertOrUpdateRecord(BasePeer.java:896)
> > 	at org.apache.torque.util.BasePeer.doUpdate(BasePeer.java:1928)
> 
> Have you tried checking the size of the array before using it? Are you 
> getting any exceptions specific to your code?
> 
> Eric
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: torque-user-unsubscribe@db.apache.org
> For additional commands, e-mail: torque-user-help@db.apache.org
-- 
Peter Courcoux <pe...@courcoux.biz>

---------------------------------------------------------------------
To unsubscribe, e-mail: torque-user-unsubscribe@db.apache.org
For additional commands, e-mail: torque-user-help@db.apache.org


Re: Village - NegativeArraySizeException

Posted by Eric Emminger <er...@ericemminger.com>.
Peter

> 2003-08-18 10:04:17,643 [Ajp13Processor[8009][4]] ERROR com.mydomain.myproject.modules.actions.MyAction - doUpdate() : Exception caught
> java.lang.NegativeArraySizeException
> 	at org.postgresql.jdbc1.AbstractJdbc1Statement.setBinaryStream(AbstractJdbc1Statement.java:1257)
> 	at com.workingdogs.village.Value.setPreparedStatementValue(Unknown Source)
> 	at com.workingdogs.village.Record.saveWithUpdate(Unknown Source)
> 	at com.workingdogs.village.Record.save(Unknown Source)
> 	at com.workingdogs.village.Record.save(Unknown Source)
> 	at org.apache.torque.util.BasePeer.insertOrUpdateRecord(BasePeer.java:896)
> 	at org.apache.torque.util.BasePeer.doUpdate(BasePeer.java:1928)

Have you tried checking the size of the array before using it? Are you 
getting any exceptions specific to your code?

Eric


---------------------------------------------------------------------
To unsubscribe, e-mail: torque-user-unsubscribe@db.apache.org
For additional commands, e-mail: torque-user-help@db.apache.org