Menu

TriggerException on update

Help
2016-09-06
2016-09-08
  • Christian Weber

    Christian Weber - 2016-09-06

    When executing

    public void updateStationState(int id, int state)
    {
        try (PreparedStatement ps
                               = conn.prepareStatement("UPDATE tblStation SET "
                                                       + "State = ? "
                                                       + "WHERE ID = ?"))
        {
            ps.setInt(1, state);
            ps.setInt(2, id);
            ps.executeUpdate();
        }
        catch (SQLException ex)
        {
            LOGGER.log(Level.SEVERE, null, ex);
        }
    }
    

    I get
    net.ucanaccess.triggers.TriggerException: 7 net.ucanaccess.triggers.TriggerException: 7

    Can you give me a hint what this exception is related to? I use the same boiler plate code at different places with different db's and they all work fine.

    Best regards
    Christian

     
  • Gord Thompson

    Gord Thompson - 2016-09-06

    Does the error only happen with that table? Does it happen consistently with that table? Have you tried doing a "Compact and Repair Database" operation in Access to see if that helps?

     
  • Christian Weber

    Christian Weber - 2016-09-06

    Hello Thank you for your response. So far it happens only on this table. The data types are Integer in the table. Compact and Repair did not help. It fails most of the time (99.9%). Hard to say what is different when it runs ok. We are a little further in the debugging.

    I have multiple connections to different databases. All are implemented as singleton classes. When I make the call in this order it works (still testing... so far it works):

        MultiCoatPluginImplementation.getVpsReportDatabase().updateStationState(1, 2); 
        MultiCoatPluginImplementation.getVpsRunSetupDatabase().updateConfirmLoading(this.stationId);
    

    If I make the call in this order it fails:

        MultiCoatPluginImplementation.getVpsRunSetupDatabase().updateConfirmLoading(this.stationId);        
        MultiCoatPluginImplementation.getVpsReportDatabase().updateStationState(1, 2);
    

    The accessed table in both databases has the same name (tblStation)

    I apprechiate your input.
    Best regards
    Christian

     
  • Marco Amadei

    Marco Amadei - 2016-09-06

    It doesn't seem to come from a 3.x.x. May you post the whole exception stacktrace?

     

    Last edit: Marco Amadei 2016-09-06
  • Christian Weber

    Christian Weber - 2016-09-07

    Hello. Please find the stacktrace below. We are under the impression that it might be related to the issue described as solved in 3.0.6. This after reading the readme file.
    We consider an update of the driver altough switching the two lines of code fixed the issue for us.

    Best regards
    Christian

    06.09.2016 11:09:01 ch.oerlikon.multicoat.plugin.models.db.report.ReportDatabase updateStationState SCHWERWIEGEND null
    net.ucanaccess.jdbc.UcanaccessSQLException: UCAExc:::3.0.3 net.ucanaccess.triggers.TriggerException: 7 net.ucanaccess.triggers.TriggerException: 7
    at net.ucanaccess.jdbc.UcanaccessPreparedStatement.executeUpdate(UcanaccessPreparedStatement.java:256)
    at ch.oerlikon.multicoat.plugin.models.db.report.ReportDatabase.updateStationState(ReportDatabase.java:443)
    at ch.oerlikon.multicoat.plugin.bl.runsetup.RunSetup.updateStationState(RunSetup.java:463)
    at ch.oerlikon.multicoat.plugin.bl.runsetup.RunSetup.confirm(RunSetup.java:456)
    at ch.oerlikon.multicoat.plugin.models.dialogs.StationConfirmDialogModel.confirmStation(StationConfirmDialogModel.java:170)
    at ch.oerlikon.multicoat.plugin.models.dialogs.StationConfirmDialogModel.updateFixture(StationConfirmDialogModel.java:124)
    at ch.oerlikon.multicoat.plugin.ui.dialogs.StationConfirmDialog$9.actionPerformed(StationConfirmDialog.java:298)
    at ch.oerlikon.multicoat.api.ui.dialogs.KeyboardDialog.btnOkActionPerformed(KeyboardDialog.java:738)
    at ch.oerlikon.multicoat.api.ui.dialogs.KeyboardDialog.access$200(KeyboardDialog.java:46)
    at ch.oerlikon.multicoat.api.ui.dialogs.KeyboardDialog$3.actionPerformed(KeyboardDialog.java:364)
    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.plaf.basic.BasicButtonListener.mouseReleased(BasicButtonListener.java:252)
    at java.awt.Component.processMouseEvent(Component.java:6516)
    at javax.swing.JComponent.processMouseEvent(JComponent.java:3321)
    at java.awt.Component.processEvent(Component.java:6281)
    at java.awt.Container.processEvent(Container.java:2229)
    at java.awt.Component.dispatchEventImpl(Component.java:4872)
    at java.awt.Container.dispatchEventImpl(Container.java:2287)
    at java.awt.Component.dispatchEvent(Component.java:4698)
    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:4698)
    at java.awt.EventQueue.dispatchEventImpl(EventQueue.java:747)
    at java.awt.EventQueue.access$300(EventQueue.java:103)
    at java.awt.EventQueue$3.run(EventQueue.java:706)
    at java.awt.EventQueue$3.run(EventQueue.java:704)
    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:720)
    at java.awt.EventQueue$4.run(EventQueue.java:718)
    at java.security.AccessController.doPrivileged(Native Method)
    at java.security.ProtectionDomain$1.doIntersectionPrivilege(ProtectionDomain.java:76)
    at java.awt.EventQueue.dispatchEvent(EventQueue.java:717)
    at java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:242)
    at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:161)
    at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:154)
    at java.awt.WaitDispatchSupport$2.run(WaitDispatchSupport.java:182)
    at java.awt.WaitDispatchSupport$4.run(WaitDispatchSupport.java:221)
    at java.security.AccessController.doPrivileged(Native Method)
    at java.awt.WaitDispatchSupport.enter(WaitDispatchSupport.java:219)
    at java.awt.Dialog.show(Dialog.java:1082)
    at java.awt.Component.show(Component.java:1655)
    at java.awt.Component.setVisible(Component.java:1607)
    at java.awt.Window.setVisible(Window.java:1014)
    at java.awt.Dialog.setVisible(Dialog.java:1005)
    at ch.oerlikon.multicoat.api.ui.dialogs.KeyboardDialog.showDialog(KeyboardDialog.java:179)
    at ch.oerlikon.multicoat.plugin.ui.dialogs.StationConfirmDialog.fixtureKeyboardButtonActionPerformed(StationConfirmDialog.java:302)
    at ch.oerlikon.multicoat.plugin.ui.dialogs.StationConfirmDialog.access$700(StationConfirmDialog.java:24)
    at ch.oerlikon.multicoat.plugin.ui.dialogs.StationConfirmDialog$6.actionPerformed(StationConfirmDialog.java:213)
    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.plaf.basic.BasicButtonListener.mouseReleased(BasicButtonListener.java:252)
    at java.awt.Component.processMouseEvent(Component.java:6516)
    at javax.swing.JComponent.processMouseEvent(JComponent.java:3321)
    at java.awt.Component.processEvent(Component.java:6281)
    at java.awt.Container.processEvent(Container.java:2229)
    at java.awt.Component.dispatchEventImpl(Component.java:4872)
    at java.awt.Container.dispatchEventImpl(Container.java:2287)
    at java.awt.Component.dispatchEvent(Component.java:4698)
    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:4698)
    at java.awt.EventQueue.dispatchEventImpl(EventQueue.java:747)
    at java.awt.EventQueue.access$300(EventQueue.java:103)
    at java.awt.EventQueue$3.run(EventQueue.java:706)
    at java.awt.EventQueue$3.run(EventQueue.java:704)
    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:720)
    at java.awt.EventQueue$4.run(EventQueue.java:718)
    at java.security.AccessController.doPrivileged(Native Method)
    at java.security.ProtectionDomain$1.doIntersectionPrivilege(ProtectionDomain.java:76)
    at java.awt.EventQueue.dispatchEvent(EventQueue.java:717)
    at java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:242)
    at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:161)
    at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:154)
    at java.awt.WaitDispatchSupport$2.run(WaitDispatchSupport.java:182)
    at java.awt.WaitDispatchSupport$4.run(WaitDispatchSupport.java:221)
    at java.security.AccessController.doPrivileged(Native Method)
    at java.awt.WaitDispatchSupport.enter(WaitDispatchSupport.java:219)
    at java.awt.Dialog.show(Dialog.java:1082)
    at java.awt.Component.show(Component.java:1655)
    at java.awt.Component.setVisible(Component.java:1607)
    at java.awt.Window.setVisible(Window.java:1014)
    at java.awt.Dialog.setVisible(Dialog.java:1005)
    at ch.oerlikon.multicoat.plugin.ui.dialogs.StationConfirmDialog.showDialog(StationConfirmDialog.java:128)
    at ch.oerlikon.multicoat.plugin.ui.pages.VacuumRecipe.ConfirmRunSettupButtonActionPerformed(VacuumRecipe.java:214)
    at ch.oerlikon.multicoat.plugin.ui.pages.VacuumRecipe.access$100(VacuumRecipe.java:36)
    at ch.oerlikon.multicoat.plugin.ui.pages.VacuumRecipe$2.actionPerformed(VacuumRecipe.java:122)
    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.plaf.basic.BasicButtonListener.mouseReleased(BasicButtonListener.java:252)
    at java.awt.Component.processMouseEvent(Component.java:6516)
    at javax.swing.JComponent.processMouseEvent(JComponent.java:3321)
    at java.awt.Component.processEvent(Component.java:6281)
    at java.awt.Container.processEvent(Container.java:2229)
    at java.awt.Component.dispatchEventImpl(Component.java:4872)
    at java.awt.Container.dispatchEventImpl(Container.java:2287)
    at java.awt.Component.dispatchEvent(Component.java:4698)
    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:4698)
    at java.awt.EventQueue.dispatchEventImpl(EventQueue.java:747)
    at java.awt.EventQueue.access$300(EventQueue.java:103)
    at java.awt.EventQueue$3.run(EventQueue.java:706)
    at java.awt.EventQueue$3.run(EventQueue.java:704)
    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:720)
    at java.awt.EventQueue$4.run(EventQueue.java:718)
    at java.security.AccessController.doPrivileged(Native Method)
    at java.security.ProtectionDomain$1.doIntersectionPrivilege(ProtectionDomain.java:76)
    at java.awt.EventQueue.dispatchEvent(EventQueue.java:717)
    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.sql.SQLException: net.ucanaccess.triggers.TriggerException: 7 net.ucanaccess.triggers.TriggerException: 7
    at org.hsqldb.jdbc.JDBCUtil.sqlException(Unknown Source)
    at org.hsqldb.jdbc.JDBCUtil.sqlException(Unknown Source)
    at org.hsqldb.jdbc.JDBCPreparedStatement.fetchResult(Unknown Source)
    at org.hsqldb.jdbc.JDBCPreparedStatement.executeUpdate(Unknown Source)
    at net.ucanaccess.jdbc.ExecuteUpdate.executeWrapped(ExecuteUpdate.java:65)
    at net.ucanaccess.jdbc.AbstractExecute.executeBase(AbstractExecute.java:152)
    at net.ucanaccess.jdbc.ExecuteUpdate.execute(ExecuteUpdate.java:50)
    at net.ucanaccess.jdbc.UcanaccessPreparedStatement.executeUpdate(UcanaccessPreparedStatement.java:253)
    ... 137 more
    Caused by: org.hsqldb.HsqlException: net.ucanaccess.triggers.TriggerException: 7
    at org.hsqldb.error.Error.error(Unknown Source)
    at org.hsqldb.result.Result.newErrorResult(Unknown Source)
    at org.hsqldb.StatementDMQL.execute(Unknown Source)
    at org.hsqldb.Session.executeCompiledStatement(Unknown Source)
    at org.hsqldb.Session.execute(Unknown Source)
    ... 143 more
    Caused by: net.ucanaccess.triggers.TriggerException: 7
    at net.ucanaccess.triggers.TriggerUpdate.fire(TriggerUpdate.java:44)
    at org.hsqldb.TriggerDef.pushPair(Unknown Source)
    at org.hsqldb.Table.fireTriggers(Unknown Source)
    at org.hsqldb.StatementDML.update(Unknown Source)
    at org.hsqldb.StatementDML.executeUpdateStatement(Unknown Source)
    at org.hsqldb.StatementDML.getResult(Unknown Source)
    ... 146 more

     
  • Marco Amadei

    Marco Amadei - 2016-09-08

    Yes, I think so. Have you tried with the 3.0.6 to get evidence?

     
  • Christian Weber

    Christian Weber - 2016-09-08

    Hello
    We updated to 3.0.6 today and will continue testing with this version. I will let you know if the issue persists...
    Thank you for the support!
    Best regards
    Christian

     

Log in to post a comment.

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.