This Bugzilla instance is a read-only archive of historic NetBeans bug reports. To report a bug in NetBeans please follow the project's instructions for reporting issues.

Bug 103931 - Inserts fail using Informix driver
Summary: Inserts fail using Informix driver
Status: RESOLVED INCOMPLETE
Alias: None
Product: obsolete
Classification: Unclassified
Component: visualweb (show other bugs)
Version: 6.x
Hardware: All All
: P3 blocker (vote)
Assignee: John Baker
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2007-05-14 18:04 UTC by John Baker
Modified: 2008-02-06 14:39 UTC (History)
1 user (show)

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments
log file (2.25 KB, application/octet-stream)
2007-05-14 21:18 UTC, jpc
Details

Note You need to log in before you can comment on or make changes to this bug.
Description John Baker 2007-05-14 18:04:13 UTC
from Customer issue sent to nb-users:

"I’m trying to put and “ADD” button to a table with the following code:

 public String add_action() {

        // TODO: Process the action. Return value is a navigation

        // case name where null will return to the same page.

       

        try {

            if ( cachedRowSetDataProvider1.canAppendRow() ) {

                RowKey appendedRow = cachedRowSetDataProvider1.appendRow();

               

                if ( appendedRow != null ) {                 

                    cachedRowSetDataProvider1.setCursorRow(appendedRow);       
                                                    

                    cachedRowSetDataProvider1.setValue("hacod", appendedRow, "XXX");

                    cachedRowSetDataProvider1.setValue("hadesign", appendedRow,
"YYYYY");                   

                    cachedRowSetDataProvider1.commitChanges();

                }

            } else {

                error("Cannot append row");

            }

        } catch (Exception e) {

            throw new FacesException(e);

        }      

        return null;

    }

 

 

However I’me getting :

 

 

java.sql.SQLException: Invalid cursor position

        at com.sun.rowset.CachedRowSetImpl.rowDeleted(CachedRowSetImpl.java:3893)

        at
com.sun.data.provider.impl.CachedRowSetDataProvider.setValue(CachedRowSetDataProvider.java:793)

        at
com.sun.data.provider.impl.AbstractTableDataProvider.setValue(AbstractTableDataProvider.java:135)

        at webcurr.Habilitacoes.add_action(Habilitacoes.java:598)

        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)

       ….

 

The exception corresponds to the setCursorRow.

 

The data provider is declared as:

 

private CachedRowSetDataProvider cachedRowSetDataProvider1 = new
CachedRowSetDataProvider();

 

and at the init:

 

 
cachedRowSetDataProvider1.setCachedRowSet((javax.sql.rowset.CachedRowSet)getValue("#{SessionBean1.cuhabilitacoesRowSet}"));

      

 

In the session bean:

 

private CachedRowSet cuhabilitacoesRowSet;

 

and at the init:

 

          cuhabilitacoesRowSet = new CachedRowSetImpl();

           
cuhabilitacoesRowSet.setDataSourceName("java:comp/env/jdbc/orirhDatasource");

            cuhabilitacoesRowSet.setCommand("SELECT ALL hacod, hadesign FROM
cuhabilitacoes  order by 1 ");

            cuhabilitacoesRowSet.setTableName("cuhabilitacoes");

            cuhabilitacoesRowSet.execute();

 

 

The datasource is working ok, the data is selected  and a “Delete”  button is
working ok."

Will ask Customer to provide Informix driver and database version, logs, etc.
Comment 1 jpc 2007-05-14 21:18:21 UTC
Created attachment 42390 [details]
log file
Comment 2 John Baker 2007-10-09 02:51:59 UTC
If still reproducible, please provide the Informix driver version