SHeinrich
Returning Observer

Externe Datenbank in FS: ID-Feld

Hallo,

ich habe eine externe SQL-Datenbank in FS als Schema importiert und würde diese gerne über FirstSpirit pflegen lassen.

Anzeige und Manipulation klappt, beim Einfügen stoße ich auf einen Fehler.

In der Tabelle gibt es eine ID-Spalte, die automatisch vom SQL-Server befüllt wird (Primärschlüssel). Ich kriege es nicht hin, dass neue Datensätze aus FirstSpirit erzegt werden können, es scheint am Counter-Generator von zu liegen. Trace siehe unten.

Hat jemand Erfahrung mit externen Datenbanken in Verbindung mit Schlüsselspalten? Die Tabelle muss auf dem SQL-Server (MS SQL) bleiben, weil diese auch von anderen ANwendungen benutzt wird.

Gruß.

Client Version: 4.2.432.43881

Java Version: 1.6.0_23 Sun Microsystems Inc.

FSVersion=4.2.432.43881#2218;JDK=1.6.0_23 32bit Sun Microsystems Inc.;OS=Windows XP 5.1 x86;Date=12.05.2011 15:07:44

de.espirit.or.CounterException: Error code: 208, state: S0002

        at de.espirit.or.impl.generic.GenericCounterGenerator.fillInitialValue(GenericCounterGenerator.java:208)

        at de.espirit.or.impl.generic.GenericCounterGenerator.getNextValue(GenericCounterGenerator.java:77)

        at de.espirit.or.impl.generic.GenericCounterGenerator.getNextValue(GenericCounterGenerator.java:20)

        at de.espirit.or.impl.PersistentContext.getNextValue(PersistentContext.java:180)

        at de.espirit.or.impl.PersistentContext.createIdentifier(PersistentContext.java:167)

        at de.espirit.or.impl.DBCommandHandler.handle(DBCommandHandler.java:47)

        at de.espirit.or.impl.CreateCommand.accept(CreateCommand.java:49)

        at de.espirit.or.impl.AbstractSessionHandler.commit(AbstractSessionHandler.java:627)

        at de.espirit.or.impl.AbstractSessionHandler.commit(AbstractSessionHandler.java:75)

        at de.espirit.firstspirit.content.ContentManagerImpl.commit(ContentManagerImpl.java:630)

        at sun.reflect.GeneratedMethodAccessor69420.invoke(Unknown Source)

        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)

        at java.lang.reflect.Method.invoke(Method.java:597)

        at de.espirit.firstspirit.io.DefaultServerHandler.callManager(DefaultServerHandler.java:62)

        at de.espirit.firstspirit.server.io.handler.ManagerCall.doCall(ManagerCall.java:91)

        at de.espirit.firstspirit.server.io.handler.CompactCall.handle(CompactCall.java:67)

        at de.espirit.firstspirit.server.io.ManagerCallWorker.run(ManagerCallWorker.java:108)

        at de.espirit.firstspirit.server.ExecutionManagerImpl$RunnableWrapper.call(ExecutionManagerImpl.java:553)

        at de.espirit.firstspirit.server.ExecutionManagerImpl$ExtendedCallable.call(ExecutionManagerImpl.java:520)

        at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:303)

        at java.util.concurrent.FutureTask.run(FutureTask.java:138)

        at de.espirit.common.util.BoundedExecutorService$RunnableWrapper.run(BoundedExecutorService.java:419)

        at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:441)

        at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:303)

        at java.util.concurrent.FutureTask.run(FutureTask.java:138)

        at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886)

        at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908)

        at java.lang.Thread.run(Thread.java:619)

        at de.espirit.common.util.SuspendableThread.run(SuspendableThread.java:36)

Caused by: com.microsoft.sqlserver.jdbc.SQLServerException: Ungültiger Objektname 'DBO.TRANSACTION_COUNTER'.

        at com.microsoft.sqlserver.jdbc.SQLServerException.makeFromDatabaseError(SQLServerException.java:196)

        at com.microsoft.sqlserver.jdbc.SQLServerStatement.getNextResult(SQLServerStatement.java:1454)

        at com.microsoft.sqlserver.jdbc.SQLServerStatement.doExecuteStatement(SQLServerStatement.java:786)

        at com.microsoft.sqlserver.jdbc.SQLServerStatement$StmtExecCmd.doExecute(SQLServerStatement.java:685)

        at com.microsoft.sqlserver.jdbc.TDSCommand.execute(IOBuffer.java:4026)

        at com.microsoft.sqlserver.jdbc.SQLServerConnection.executeCommand(SQLServerConnection.java:1416)

        at com.microsoft.sqlserver.jdbc.SQLServerStatement.executeCommand(SQLServerStatement.java:185)

        at com.microsoft.sqlserver.jdbc.SQLServerStatement.executeStatement(SQLServerStatement.java:160)

        at com.microsoft.sqlserver.jdbc.SQLServerStatement.executeQuery(SQLServerStatement.java:620)

        at de.espirit.or.impl.generic.GenericCounterGenerator.fillInitialValue(GenericCounterGenerator.java:193)

        at de.espirit.or.impl.generic.GenericCounterGenerator.getNextValue(GenericCounterGenerator.java:77)

        at de.espirit.or.impl.generic.GenericCounterGenerator.getNextValue(GenericCounterGenerator.java:20)

        at de.espirit.or.impl.PersistentContext.getNextValue(PersistentContext.java:180)

        at de.espirit.or.impl.PersistentContext.createIdentifier(PersistentContext.java:167)

        at de.espirit.or.impl.DBCommandHandler.handle(DBCommandHandler.java:47)

        at de.espirit.or.impl.CreateCommand.accept(CreateCommand.java:49)

        at de.espirit.or.impl.AbstractSessionHandler.commit(AbstractSessionHandler.java:627)

        at de.espirit.or.impl.AbstractSessionHandler.commit(AbstractSessionHandler.java:75)

        at de.espirit.firstspirit.content.ContentManagerImpl.commit(ContentManagerImpl.java:630)

        at sun.reflect.GeneratedMethodAccessor69420.invoke(Unknown Source)

        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)

        at java.lang.reflect.Method.invoke(Method.java:597)

        at de.espirit.firstspirit.io.DefaultServerHandler.callManager(DefaultServerHandler.java:62)

        at de.espirit.firstspirit.server.io.handler.ManagerCall.doCall(ManagerCall.java:91)

        at de.espirit.firstspirit.server.io.handler.CompactCall.handle(CompactCall.java:67)

        at de.espirit.firstspirit.server.io.ManagerCallWorker.run(ManagerCallWorker.java:108)

        at de.espirit.firstspirit.server.ExecutionManagerImpl$RunnableWrapper.call(ExecutionManagerImpl.java:553)

        at de.espirit.firstspirit.server.ExecutionManagerImpl$ExtendedCallable.call(ExecutionManagerImpl.java:520)

        at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:303)

        at java.util.concurrent.FutureTask.run(FutureTask.java:138)

        at de.espirit.common.util.BoundedExecutorService$RunnableWrapper.run(BoundedExecutorService.java:419)

        at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:441)

        at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:303)

        at java.util.concurrent.FutureTask.run(FutureTask.java:138)

        at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886)

        at de.espirit.firstspirit.client.io.ServerCaller.callManager(ServerCaller.java:372)

        at de.espirit.firstspirit.io.DefaultClientHandler.callManager(DefaultClientHandler.java:49)

        at de.espirit.firstspirit.client.io.RemoteManagerCaller.invoke(RemoteManagerCaller.java:52)

        at de.espirit.firstspirit.server.$Proxy83.commit(Unknown Source)

        at de.espirit.firstspirit.store.access.templatestore.SessionHandlerImpl.commit(SessionHandlerImpl.java:113)

        at de.espirit.or.impl.SessionImpl.doCommit(SessionImpl.java:191)

        at de.espirit.or.impl.AbstractSession.commit(AbstractSession.java:525)

        at de.espirit.firstspirit.client.gui.tree.store.contentstore.AbstractGuiXmlPanel.save(AbstractGuiXmlPanel.java:417)

        at de.espirit.firstspirit.client.gui.tree.store.contentstore.ContentGuiXmlPanel.persist(ContentGuiXmlPanel.java:385)

        at de.espirit.firstspirit.client.gui.tree.store.contentstore.ContentGuiXmlPanel.persist(ContentGuiXmlPanel.java:356)

        at de.espirit.firstspirit.client.gui.tree.store.contentstore.ContentGuiXmlPanel.save(ContentGuiXmlPanel.java:351)

        at de.espirit.firstspirit.client.gui.tree.store.contentstore.ContentGuiXmlPanel$GuiXmlToolbar$2.actionPerformed(ContentGuiXmlPanel.java:536)

        at javax.swing.AbstractButton.fireActionPerformed(Unknown Source)

        at de.espirit.firstspirit.common.gui.StoreHoverButton.fireActionPerformed(StoreHoverButton.java:97)

        at javax.swing.AbstractButton$Handler.actionPerformed(Unknown Source)

        at javax.swing.DefaultButtonModel.fireActionPerformed(Unknown Source)

        at javax.swing.DefaultButtonModel.setPressed(Unknown Source)

        at javax.swing.plaf.basic.BasicButtonListener.mouseReleased(Unknown Source)

        at java.awt.AWTEventMulticaster.mouseReleased(Unknown Source)

        at java.awt.Component.processMouseEvent(Unknown Source)

        at javax.swing.JComponent.processMouseEvent(Unknown Source)

        at java.awt.Component.processEvent(Unknown Source)

        at java.awt.Container.processEvent(Unknown Source)

        at java.awt.Component.dispatchEventImpl(Unknown Source)

        at java.awt.Container.dispatchEventImpl(Unknown Source)

        at java.awt.Component.dispatchEvent(Unknown Source)

        at java.awt.LightweightDispatcher.retargetMouseEvent(Unknown Source)

        at java.awt.LightweightDispatcher.processMouseEvent(Unknown Source)

        at java.awt.LightweightDispatcher.dispatchEvent(Unknown Source)

        at java.awt.Container.dispatchEventImpl(Unknown Source)

        at java.awt.Window.dispatchEventImpl(Unknown Source)

        at java.awt.Component.dispatchEvent(Unknown Source)

        at java.awt.EventQueue.dispatchEvent(Unknown Source)

        at de.espirit.firstspirit.client.AWTDispatchingEventQueue.defaultDispatchEvent(AWTDispatchingEventQueue.java:130)

        at de.espirit.firstspirit.client.AWTDispatchingEventQueue._dispatchEvent(AWTDispatchingEventQueue.java:115)

        at de.espirit.firstspirit.client.AWTDispatchingEventQueue.dispatchEvent(AWTDispatchingEventQueue.java:108)

        at java.awt.EventDispatchThread.pumpOneEventForFilters(Unknown Source)

        at java.awt.EventDispatchThread.pumpEventsForFilter(Unknown Source)

        at java.awt.EventDispatchThread.pumpEventsForHierarchy(Unknown Source)

        at java.awt.EventDispatchThread.pumpEvents(Unknown Source)

        at java.awt.EventDispatchThread.pumpEvents(Unknown Source)

0 Kudos
1 Reply
linde
Elite Observer

Soweit ich weiss, kann eine externe Datenbank nur read-only eingebunden werden. Wenn die Daten über FirstSpirit als führendes System gepflegt werden soll, dann muss das über ein FirstSpirit Schema angelegt werden. Neben der FS_ID werden weitere Spalten in der tatsächlich angelegten Tabelle für die Revisionierung und die Workflowsteuerung automatisch mit angelegt.

Die FS_ID wird über alle Tabellen eines FirstSpirit Schemas hinweg hochgezählt (das könnte der Trasaction Counter sein), d.h. das ist keine Sequence in der einzelnen Tabelle. Das wird von FirstSpirit kontrolliert und dürfte nicht von aussen über das externe Datenmodell vorgegeben werden können.

0 Kudos