Board index » jbuilder » ArrayIndexOutOfBoundsException after setSort()

ArrayIndexOutOfBoundsException after setSort()


2003-09-13 08:28:45 AM
jbuilder1
I would appreciate any information regarding the following problem. I am
running in JBuilder9 and accessing SQLServer.
After getting a queryDataSet(), I can update a row. But after executing a
setSort() on the dataset, then all updateRows fail.
Thank you in advance......
QueryDataSet ds
....
DataRow row = new DataRow(ds);
ds.getDataRow(row);
ds.updateRow(row); /* executes fine */
ds.setSort(new com.borland.dx.dataset.SortDescriptor(new String[] {
"LASTNAME" }, true, false)); /* sort completes fine */
ds.updateRow(row); /* fails with following stacktrace */
java.lang.ArrayIndexOutOfBoundsException: -1
at com.borland.dx.memorystore.c.a(Unknown Source)
at com.borland.dx.memorystore.c.b(Unknown Source)
at com.borland.dx.memorystore.l.a(Unknown Source)
at com.borland.dx.memorystore.e.a(Unknown Source)
at com.borland.dx.memorystore.i.findClosest(Unknown Source) EXCEPTION: -1
at com.borland.dx.memorystore.i.findClosest(Unknown Source)
at com.borland.dx.dataset.DataSet.i(Unknown Source)
at com.borland.dx.dataset.DataSet.goToInternalRow(Unknown Source)
at com.borland.dx.dataset.DataSet.b(Unknown Source)
at com.borland.dx.dataset.DataSet.updateRow(Unknown Source)
at lads.share.MainFrame.jbInit(MainFrame.java:93)
at lads.share.MainFrame.<init>(MainFrame.java:47)
at lads.share.MainFrame.main(MainFrame.java:56)
 
 

Re:ArrayIndexOutOfBoundsException after setSort()

Chris McClain wrote:
Quote

I would appreciate any information regarding the following problem. I am
running in JBuilder9 and accessing SQLServer.
After getting a queryDataSet(), I can update a row. But after executing a
setSort() on the dataset, then all updateRows fail.
Thank you in advance......


QueryDataSet ds
....
DataRow row = new DataRow(ds);
ds.getDataRow(row);
ds.updateRow(row); /* executes fine */
ds.setSort(new com.borland.dx.dataset.SortDescriptor(new String[] {
"LASTNAME" }, true, false)); /* sort completes fine */
ds.updateRow(row); /* fails with following stacktrace */




java.lang.ArrayIndexOutOfBoundsException: -1
at com.borland.dx.memorystore.c.a(Unknown Source)
at com.borland.dx.memorystore.c.b(Unknown Source)
at com.borland.dx.memorystore.l.a(Unknown Source)
at com.borland.dx.memorystore.e.a(Unknown Source)
at com.borland.dx.memorystore.i.findClosest(Unknown Source) EXCEPTION: -1
at com.borland.dx.memorystore.i.findClosest(Unknown Source)
at com.borland.dx.dataset.DataSet.i(Unknown Source)
at com.borland.dx.dataset.DataSet.goToInternalRow(Unknown Source)
at com.borland.dx.dataset.DataSet.b(Unknown Source)
at com.borland.dx.dataset.DataSet.updateRow(Unknown Source)
at lads.share.MainFrame.jbInit(MainFrame.java:93)
at lads.share.MainFrame.<init>(MainFrame.java:47)
at lads.share.MainFrame.main(MainFrame.java:56)
Do you have the rowID defined on the sort row in the Dataset? If not, that
is your problem. You are attmpting to update on a non updateable key.
 

Re:ArrayIndexOutOfBoundsException after setSort()

Hi,
I'm working with Chris to help solve this problem. Here's what I've been
able to find out.
If I use the dx.jar from JBuilder 7, the code works fine. Also, if I
remove the edit listener with JBuilder 9 dx.jar the code works fine.
Any other ideas?
Lamar
pNichols wrote:
Quote
Chris McClain wrote:


>I would appreciate any information regarding the following problem. I am
>running in JBuilder9 and accessing SQLServer.
>After getting a queryDataSet(), I can update a row. But after executing a
>setSort() on the dataset, then all updateRows fail.
>Thank you in advance......
>
>
>QueryDataSet ds
>....
>DataRow row = new DataRow(ds);
>ds.getDataRow(row);
>ds.updateRow(row); /* executes fine */
>ds.setSort(new com.borland.dx.dataset.SortDescriptor(new String[] {
>"LASTNAME" }, true, false)); /* sort completes fine */
>ds.updateRow(row); /* fails with following stacktrace */
>
>
>
>
>java.lang.ArrayIndexOutOfBoundsException: -1
>at com.borland.dx.memorystore.c.a(Unknown Source)
>at com.borland.dx.memorystore.c.b(Unknown Source)
>at com.borland.dx.memorystore.l.a(Unknown Source)
>at com.borland.dx.memorystore.e.a(Unknown Source)
>at com.borland.dx.memorystore.i.findClosest(Unknown Source) EXCEPTION: -1
>at com.borland.dx.memorystore.i.findClosest(Unknown Source)
>at com.borland.dx.dataset.DataSet.i(Unknown Source)
>at com.borland.dx.dataset.DataSet.goToInternalRow(Unknown Source)
>at com.borland.dx.dataset.DataSet.b(Unknown Source)
>at com.borland.dx.dataset.DataSet.updateRow(Unknown Source)
>at lads.share.MainFrame.jbInit(MainFrame.java:93)
>at lads.share.MainFrame.<init>(MainFrame.java:47)
>at lads.share.MainFrame.main(MainFrame.java:56)



Do you have the rowID defined on the sort row in the Dataset? If not, that
is your problem. You are attmpting to update on a non updateable key.

 

{smallsort}