Leon Messerschmidt wrote:
> Because the IDBroker does updates that are outside of your control we need to have
> a look at this. I think it will work if we add the following line before we call
> doUpdate:
>
> criteria.setDbName ( tableMap.getDatabaseMap().getName() );
>
> Any thoughts on this?
>
This piece of code above looks like a good idea to me. It would solve the problem of
only being able to have an ID_TABLE in the default database. But I still have the
problem that I mentioned before unfortunately. Before I got your message I realized
this bug and just used the DatabaseMap for the default table. So here is the
sceneario:
1. I start tomcat. Everything works great. IDBroker works indefinately....
2. I modify some code in my application, but I don't touch any other class.
IDBroker ceases to work and gives me this stack trace:
java.lang.NullPointerException:
at org.apache.turbine.om.peer.BasePeer.doUpdate(BasePeer.java:1183)
at org.apache.turbine.util.db.IDBroker.storeIDs(IDBroker.java:334)
at org.apache.turbine.util.db.IDBroker.getNextIds(IDBroker.java:203)
at org.apache.turbine.util.db.IDBroker.getNextId(IDBroker.java:179)
at
com.compassarts.modules.actions.TimeSheet.UpdateSheet.doPerform(UpdateSheet.java:36)
at org.apache.turbine.modules.Action.perform(Action.java:77)
at org.apache.turbine.modules.ActionLoader.exec(ActionLoader.java:111)
at org.apache.turbine.modules.pages.DefaultPage.doBuild(DefaultPage.java:79)
at org.apache.turbine.modules.Page.build(Page.java:81)
at org.apache.turbine.modules.PageLoader.exec(PageLoader.java:111)
at Turbine.doGet(Turbine.java:298)
at Turbine.doPost(Turbine.java:368)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:760)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
at org.apache.tomcat.core.ServletWrapper.doService(ServletWrapper.java:368)
at org.apache.tomcat.core.Handler.service(Handler.java:261)
at org.apache.tomcat.core.ServletWrapper.service(ServletWrapper.java:356)
at
org.apache.tomcat.core.ContextManager.internalService(ContextManager.java:720)
at org.apache.tomcat.core.ContextManager.service(ContextManager.java:666)
at
org.apache.tomcat.service.connector.Ajp12ConnectionHandler.processConnection(Ajp12ConnectionHandler.java:166)
at org.apache.tomcat.service.TcpWorkerThread.runIt(PoolTcpEndpoint.java:403)
at org.apache.tomcat.util.ThreadPool$ControlRunnable.run(ThreadPool.java:498)
at java.lang.Thread.run(Thread.java)
3. IDBroker does output a lot to the log file. The time of access to the page that
is IDBroker is 35:10.
[Thu Aug 03 22:35:10 EDT 2000] -- WARNING -- IDBroker is being used with db: default
which does not support transactions. It is possible to
generate duplicate keys, if multiple JVM's are used or other
means are used to write to the database.
[Thu Aug 03 22:35:10 EDT 2000] -- NOTICE -- Forced id retrieval - no available
vector
[Thu Aug 03 22:35:10 EDT 2000] -- NOTICE -- IDBroker thread was started.
[Thu Aug 03 22:35:10 EDT 2000] -- NOTICE -- IDBroker thread checking for more keys.
[Thu Aug 03 22:35:19 EDT 2000] -- NOTICE -- IDBroker thread checking for more keys.
[Thu Aug 03 22:35:22 EDT 2000] -- NOTICE -- IDBroker thread checking for more keys.
[Thu Aug 03 22:35:22 EDT 2000] -- NOTICE -- IDBroker thread checking for more keys
on table:Dentry
[Thu Aug 03 22:35:32 EDT 2000] -- NOTICE -- IDBroker thread checking for more keys.
[Thu Aug 03 22:35:32 EDT 2000] -- NOTICE -- IDBroker thread checking for more keys.
[Thu Aug 03 22:35:32 EDT 2000] -- NOTICE -- IDBroker thread checking for more keys.
[Thu Aug 03 22:35:32 EDT 2000] -- NOTICE -- IDBroker thread checking for more keys
on table:Dentry
4. My code:
DatabaseMap dbMap =
DBBroker.getInstance().getDatabaseMap(DBBroker.DEFAULT);
dbMap.setIdTable("Dentry");
IDBroker idb = dbMap.getIDBroker();
int didInt = idb.getNextId("Dentry").intValue();
Any ideas? I just don't see what could be happening.
Thanks for your help,
Dan Diephouse
------------------------------------------------------------
To subscribe: [EMAIL PROTECTED]
To unsubscribe: [EMAIL PROTECTED]
Search: <http://www.mail-archive.com/turbine%40list.working-dogs.com/>
Problems?: [EMAIL PROTECTED]