Hi !
I use H2 in a Java Program.
This SQL order give an error :

SQL = *INSERT INTO POINTS(id,longitude,latitude) VALUES 
(48602,25.91,46.05);*
*INSERT INTO POINTS(id,longitude,latitude) VALUES (48603,25.88,46.22);*
*INSERT INTO POINTS(id,longitude,latitude) VALUES (48604,25.79,46.37);*
*INSERT INTO POINTS(id,longitude,latitude) VALUES (48605,25.65,46.49);*
*INSERT INTO POINTS(id,longitude,latitude) VALUES (48606,25.47,46.56);*
*INSERT INTO POINTS(id,longitude,latitude) VALUES (48607,25.51,46.7);*
*INSERT INTO POINTS(id,longitude,latitude) VALUES (48608,25.42,46.84);*
*INSERT INTO Limes(id,id_premier_point,id_dernier_point) VALUES 
(1545,48602,48608);*

Error = *org.h2.jdbc.JdbcSQLException: General error: 
"java.lang.RuntimeException: rowCount expected 48602 got 48583 
POINTS.I_LG_LA"; SQL statement:*
*INSERT INTO POINTS(id,longitude,latitude) VALUES (48602,25.91,46.05);*
*INSERT INTO POINTS(id,longitude,latitude) VALUES (48603,25.88,46.22);*
*INSERT INTO POINTS(id,longitude,latitude) VALUES (48604,25.79,46.37);*
*INSERT INTO POINTS(id,longitude,latitude) VALUES (48605,25.65,46.49);*
*INSERT INTO POINTS(id,longitude,latitude) VALUES (48606,25.47,46.56);*
*INSERT INTO POINTS(id,longitude,latitude) VALUES (48607,25.51,46.7);*
*INSERT INTO POINTS(id,longitude,latitude) VALUES (48608,25.42,46.84);*
*INSERT INTO Limes(id,id_premier_point,id_dernier_point) VALUES 
(1545,48602,48608); [50000-160]*
* at org.h2.message.DbException.getJdbcSQLException(DbException.java:329)*
* at org.h2.message.DbException.get(DbException.java:158)*
* at org.h2.message.DbException.convert(DbException.java:281)*
* at org.h2.table.RegularTable.addRow(RegularTable.java:139)*
* at org.h2.command.dml.Insert.insertRows(Insert.java:124)*
* at org.h2.command.dml.Insert.update(Insert.java:84)*
* at org.h2.command.CommandContainer.update(CommandContainer.java:73)*
* at org.h2.command.Command.executeUpdate(Command.java:219)*
* at org.h2.command.CommandList.update(CommandList.java:41)*
* at org.h2.command.Command.executeUpdate(Command.java:219)*
* at 
org.h2.jdbc.JdbcStatement.executeUpdateInternal(JdbcStatement.java:125)*
* at org.h2.jdbc.JdbcStatement.executeUpdate(JdbcStatement.java:110)*
* at 
gestionhistoiremondiale.donnees.ConnexionBase.execute(ConnexionBase.java:257)*
* at 
gestionhistoiremondialeMVC.vue.tableau.points.PointsModele.enregistrer(PointsModele.java:154)*
* at 
gestionhistoiremondialeMVC.vue.tableau.abstrait.Tableau.enregistrer(Tableau.java:114)*
* at 
gestionhistoiremondialeMVC.vue.document.DocumentTableau.enregistrer(DocumentTableau.java:142)*
* at 
gestionhistoiremondialeMVC.vue.document.DocumentTableau$2.actionPerformed(DocumentTableau.java:79)*
* at 
javax.swing.AbstractButton.fireActionPerformed(AbstractButton.java:2018)*
* at 
javax.swing.AbstractButton$Handler.actionPerformed(AbstractButton.java:2341)*
* at 
javax.swing.DefaultButtonModel.fireActionPerformed(DefaultButtonModel.java:402)*
* at javax.swing.DefaultButtonModel.setPressed(DefaultButtonModel.java:259)*
* at javax.swing.AbstractButton.doClick(AbstractButton.java:376)*
* at 
javax.swing.plaf.basic.BasicMenuItemUI.doClick(BasicMenuItemUI.java:833)*
* at 
javax.swing.plaf.basic.BasicMenuItemUI$Handler.mouseReleased(BasicMenuItemUI.java:877)*
* at java.awt.Component.processMouseEvent(Component.java:6505)*
* at javax.swing.JComponent.processMouseEvent(JComponent.java:3321)*
* at java.awt.Component.processEvent(Component.java:6270)*
* at java.awt.Container.processEvent(Container.java:2229)*
* at java.awt.Component.dispatchEventImpl(Component.java:4861)*
* at java.awt.Container.dispatchEventImpl(Container.java:2287)*
* at java.awt.Component.dispatchEvent(Component.java:4687)*
* at java.awt.LightweightDispatcher.retargetMouseEvent(Container.java:4832)*
* at java.awt.LightweightDispatcher.processMouseEvent(Container.java:4492)*
* at java.awt.LightweightDispatcher.dispatchEvent(Container.java:4422)*
* at java.awt.Container.dispatchEventImpl(Container.java:2273)*
* at java.awt.Window.dispatchEventImpl(Window.java:2719)*
* at java.awt.Component.dispatchEvent(Component.java:4687)*
* at java.awt.EventQueue.dispatchEventImpl(EventQueue.java:735)*
* at java.awt.EventQueue.access$200(EventQueue.java:103)*
* at java.awt.EventQueue$3.run(EventQueue.java:694)*
* at java.awt.EventQueue$3.run(EventQueue.java:692)*
* at java.security.AccessController.doPrivileged(Native Method)*
* at 
java.security.ProtectionDomain$1.doIntersectionPrivilege(ProtectionDomain.java:76)*
* at 
java.security.ProtectionDomain$1.doIntersectionPrivilege(ProtectionDomain.java:87)*
* at java.awt.EventQueue$4.run(EventQueue.java:708)*
* at java.awt.EventQueue$4.run(EventQueue.java:706)*
* at java.security.AccessController.doPrivileged(Native Method)*
* at 
java.security.ProtectionDomain$1.doIntersectionPrivilege(ProtectionDomain.java:76)*
* at java.awt.EventQueue.dispatchEvent(EventQueue.java:705)*
* at 
java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:242)*
* at 
java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:161)*
* at 
java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:150)*
* at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:146)*
* at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:138)*
* at java.awt.EventDispatchThread.run(EventDispatchThread.java:91)*
*Caused by: java.lang.RuntimeException: rowCount expected 48602 got 48583 
POINTS.I_LG_LA*
* at org.h2.message.DbException.throwInternalError(DbException.java:228)*
* at org.h2.table.RegularTable.checkRowCount(RegularTable.java:169)*
* at org.h2.table.RegularTable.addRow(RegularTable.java:122)*
* ... 51 more*
I understand the meaning of the error : h2 expect 48602 rows in the table 
POINTS and got 48583.
The number of row is incorrect.

The method for execute the SQL command is *ConnexionBase.execute(SQL);*
In the class ConnexionBase we have
*    public static void execute(String sql)*
*    {*
*        try *
*        {*
*            //un traitement avec base modifiable (CONCUR_UPDATABLE) que 
l'on peut parcourir *
*            //dans les deux sens avec changements immédiatement visibles*
*            Statement stmt = 
connexionCourante().createStatement(ResultSet.TYPE_SCROLL_INSENSITIVE, *
*                                                                
 ResultSet.CONCUR_UPDATABLE);*
*            stmt.executeUpdate(sql);*
*            stmt.close ();*
*        } *
*        catch (SQLException e) *
*        {*
*            e.printStackTrace();*
*        } *
*    }*

I precise that my table POINTS has 48601 data (1 to 48601).


My answer is why i have this error and how i can resolve that.

Thanks and sorry for my very poor english.

PATRICE

-- 
You received this message because you are subscribed to the Google Groups "H2 
Database" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/h2-database.
For more options, visit https://groups.google.com/groups/opt_out.

Reply via email to