Sziasztok!<br clear="all"><br>Egy érdekességbe futottam bele:<br>Van egy hibernate alapú Swing alkalmazásom. Ha jól olvastam, akkor bármilyen hibernate hiba esetén a sessiont le kell zárnom, és újat kell nyitnom. Ezt szeretném megoldani minél kevesebb fájdalommal. A hibák a runtimeexception leszármazott hibernateexception leszármazottjai formájában indulnak útjukra.<br>
<br>Szóval van egy fő formom, ahonnan egy dupla klikk segítségével egy modális dialogra jutok. Ott egy gomb megnyomására szeretnék bekérni egy listát, aminek során egy hibát ejtettem.<br><br>A hibát el tudom kapni a lista lekérését végző eljárásban, valamint az eljárás hívásakor a modális dialogban.<br>
Viszont nem tudom elkapni a fő formon: catch(Exception e)<br><br>Eddig úgy tudtam, hogy a modális dialógok a hívó threadon belül futnak, és ezt látszik megerősíteni a stack trace is: szerepel benne a fő formon szereplő egérkezelő. Tehát véleményem szerint az exceptionnak odáig vissza kellene csorognia, és ott el kellene kapnom.<br>
<br>Hol a hiba az érvelésben? Miért nem tudom a fő formon elkapni az exceptiont?<br><br>Üdv:<br><b>VigB</b><br><br>ui: A fontosabb részeket megjelöltem --> <br><br>----------- 8< ------------<br>Exception in thread "AWT-EventQueue-0" org.hibernate.hql.internal.ast.QuerySyntaxException: DsrProceddures is not mapped [from DsrProceddures order by PROC_NAME]<br>
at org.hibernate.hql.internal.ast.util.SessionFactoryHelper.requireClassPersister(SessionFactoryHelper.java:180)<br> at org.hibernate.hql.internal.ast.tree.FromElementFactory.addFromElement(FromElementFactory.java:110)<br>
at org.hibernate.hql.internal.ast.tree.FromClause.addFromElement(FromClause.java:93)<br> at org.hibernate.hql.internal.ast.HqlSqlWalker.createFromElement(HqlSqlWalker.java:324)<br> at org.hibernate.hql.internal.antlr.HqlSqlBaseWalker.fromElement(HqlSqlBaseWalker.java:3291)<br>
at org.hibernate.hql.internal.antlr.HqlSqlBaseWalker.fromElementList(HqlSqlBaseWalker.java:3180)<br> at org.hibernate.hql.internal.antlr.HqlSqlBaseWalker.fromClause(HqlSqlBaseWalker.java:706)<br> at org.hibernate.hql.internal.antlr.HqlSqlBaseWalker.query(HqlSqlBaseWalker.java:562)<br>
at org.hibernate.hql.internal.antlr.HqlSqlBaseWalker.selectStatement(HqlSqlBaseWalker.java:299)<br> at org.hibernate.hql.internal.antlr.HqlSqlBaseWalker.statement(HqlSqlBaseWalker.java:247)<br> at org.hibernate.hql.internal.ast.QueryTranslatorImpl.analyze(QueryTranslatorImpl.java:248)<br>
at org.hibernate.hql.internal.ast.QueryTranslatorImpl.doCompile(QueryTranslatorImpl.java:183)<br> at org.hibernate.hql.internal.ast.QueryTranslatorImpl.compile(QueryTranslatorImpl.java:136)<br> at org.hibernate.engine.query.spi.HQLQueryPlan.<init>(HQLQueryPlan.java:105)<br>
at org.hibernate.engine.query.spi.HQLQueryPlan.<init>(HQLQueryPlan.java:80)<br> at org.hibernate.engine.query.spi.QueryPlanCache.getHQLQueryPlan(QueryPlanCache.java:168)<br> at org.hibernate.internal.AbstractSessionImpl.getHQLQueryPlan(AbstractSessionImpl.java:219)<br>
at org.hibernate.internal.AbstractSessionImpl.createQuery(AbstractSessionImpl.java:197)<br> at org.hibernate.internal.SessionImpl.createQuery(SessionImpl.java:1736)<br>--> hibás eljárás ---> at dsr_framework.Helper.getAllProcedures(Helper.java:269)<br>
--> még itt is elkapható --> at dsr_framework.nodeeditor.NodeEditorDialog.btnNewProcActionPerformed(NodeEditorDialog.java:375)<br> at dsr_framework.nodeeditor.NodeEditorDialog.access$300(NodeEditorDialog.java:23)<br>
at dsr_framework.nodeeditor.NodeEditorDialog$4.actionPerformed(NodeEditorDialog.java:117)<br> at javax.swing.AbstractButton.fireActionPerformed(AbstractButton.java:2018)<br> at javax.swing.AbstractButton$Handler.actionPerformed(AbstractButton.java:2341)<br>
at javax.swing.DefaultButtonModel.fireActionPerformed(DefaultButtonModel.java:402)<br> at javax.swing.DefaultButtonModel.setPressed(DefaultButtonModel.java:259)<br> at javax.swing.plaf.basic.BasicButtonListener.mouseReleased(BasicButtonListener.java:252)<br>
at java.awt.Component.processMouseEvent(Component.java:6505)<br> at javax.swing.JComponent.processMouseEvent(JComponent.java:3321)<br> at java.awt.Component.processEvent(Component.java:6270)<br> at java.awt.Container.processEvent(Container.java:2229)<br>
at java.awt.Component.dispatchEventImpl(Component.java:4861)<br> at java.awt.Container.dispatchEventImpl(Container.java:2287)<br> at java.awt.Component.dispatchEvent(Component.java:4687)<br> at java.awt.LightweightDispatcher.retargetMouseEvent(Container.java:4832)<br>
at java.awt.LightweightDispatcher.processMouseEvent(Container.java:4492)<br> at java.awt.LightweightDispatcher.dispatchEvent(Container.java:4422)<br> at java.awt.Container.dispatchEventImpl(Container.java:2273)<br>
at java.awt.Window.dispatchEventImpl(Window.java:2719)<br> at java.awt.Component.dispatchEvent(Component.java:4687)<br> at java.awt.EventQueue.dispatchEventImpl(EventQueue.java:703)<br> at java.awt.EventQueue.access$000(EventQueue.java:102)<br>
at java.awt.EventQueue$3.run(EventQueue.java:662)<br> at java.awt.EventQueue$3.run(EventQueue.java:660)<br> at java.security.AccessController.doPrivileged(Native Method)<br> at java.security.ProtectionDomain$1.doIntersectionPrivilege(ProtectionDomain.java:76)<br>
at java.security.ProtectionDomain$1.doIntersectionPrivilege(ProtectionDomain.java:87)<br> at java.awt.EventQueue$4.run(EventQueue.java:676)<br> at java.awt.EventQueue$4.run(EventQueue.java:674)<br> at java.security.AccessController.doPrivileged(Native Method)<br>
at java.security.ProtectionDomain$1.doIntersectionPrivilege(ProtectionDomain.java:76)<br> at java.awt.EventQueue.dispatchEvent(EventQueue.java:673)<br> at java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:244)<br>
at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:163)<br> at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:155)<br> at java.awt.WaitDispatchSupport$2.run(WaitDispatchSupport.java:182)<br>
at java.awt.WaitDispatchSupport$4.run(WaitDispatchSupport.java:221)<br> at java.security.AccessController.doPrivileged(Native Method)<br> at java.awt.WaitDispatchSupport.enter(WaitDispatchSupport.java:219)<br> at java.awt.Dialog.show(Dialog.java:1072)<br>
at java.awt.Component.show(Component.java:1651)<br> at java.awt.Component.setVisible(Component.java:1603)<br> at java.awt.Window.setVisible(Window.java:1014)<br> at java.awt.Dialog.setVisible(Dialog.java:1003)<br>
--> itt lesz létrehozva a modal dialog --> at dsr_framework.NodeTreeNode.performActionEvent(NodeTreeNode.java:58)<br>--> fő form --> at dsr_framework.DSR_Frame$PopupListener.mouseClicked(DSR_Frame.java:307)<br>
at java.awt.AWTEventMulticaster.mouseClicked(AWTEventMulticaster.java:270)<br> at java.awt.Component.processMouseEvent(Component.java:6508)<br> at javax.swing.JComponent.processMouseEvent(JComponent.java:3321)<br>
at java.awt.Component.processEvent(Component.java:6270)<br> at java.awt.Container.processEvent(Container.java:2229)<br> at java.awt.Component.dispatchEventImpl(Component.java:4861)<br> at java.awt.Container.dispatchEventImpl(Container.java:2287)<br>
at java.awt.Component.dispatchEvent(Component.java:4687)<br> at java.awt.LightweightDispatcher.retargetMouseEvent(Container.java:4832)<br> at java.awt.LightweightDispatcher.processMouseEvent(Container.java:4501)<br>
at java.awt.LightweightDispatcher.dispatchEvent(Container.java:4422)<br> at java.awt.Container.dispatchEventImpl(Container.java:2273)<br> at java.awt.Window.dispatchEventImpl(Window.java:2719)<br> at java.awt.Component.dispatchEvent(Component.java:4687)<br>
at java.awt.EventQueue.dispatchEventImpl(EventQueue.java:703)<br> at java.awt.EventQueue.access$000(EventQueue.java:102)<br> at java.awt.EventQueue$3.run(EventQueue.java:662)<br> at java.awt.EventQueue$3.run(EventQueue.java:660)<br>
at java.security.AccessController.doPrivileged(Native Method)<br> at java.security.ProtectionDomain$1.doIntersectionPrivilege(ProtectionDomain.java:76)<br> at java.security.ProtectionDomain$1.doIntersectionPrivilege(ProtectionDomain.java:87)<br>
at java.awt.EventQueue$4.run(EventQueue.java:676)<br> at java.awt.EventQueue$4.run(EventQueue.java:674)<br> at java.security.AccessController.doPrivileged(Native Method)<br> at java.security.ProtectionDomain$1.doIntersectionPrivilege(ProtectionDomain.java:76)<br>
at java.awt.EventQueue.dispatchEvent(EventQueue.java:673)<br> at java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:244)<br> at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:163)<br>
at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:151)<br> at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:147)<br> at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:139)<br>
at java.awt.EventDispatchThread.run(EventDispatchThread.java:97)<br>