Antville Project

antville & odbc

inspired by the discussion at langreiter.com, i tried to connect antville with a microsoft access database via odbc on win2k.

this is what i did so far:

  1. downloaded and installed myodbc 2.5 driver.
  2. imported antville mysql database into access database file antville.mdb.
  3. created system dsn "antville" using access driver and referring to the antville.mdb with u/p permissions antville/antville.
  4. set-up antville's db.properties like this: antville.url=jdbc:odbc:antville antville.driver=sun.jdbc.odbc.JdbcOdbcDriver antville.user=antville antville.password=antville.
  5. restarted hop.bat.
everything went fine until pointing the browser to antville main where i get a "resultset is closed" error with every select statement. this error occured under both, 1.31 and 1.4rc, tested java versions.

comment    

 
tobi, February 6, 2002 at 12:34:12 PM CET

direct db

is working...

link  


... comment
 
tobi, February 6, 2002 at 12:39:19 PM CET

sql exception

java.sql.SQLException: ResultSet is closed at sun.jdbc.odbc.JdbcOdbcResultSet.checkOpen(JdbcOdbcResultSet.java:6455 ) at sun.jdbc.odbc.JdbcOdbcResultSet.clearWarnings(JdbcOdbcResultSet.java: 1747) at sun.jdbc.odbc.JdbcOdbcResultSet.close(JdbcOdbcResultSet.java:1452) at com.workingdogs.village.DataSet.close(DataSet.java:337) at helma.objectmodel.db.NodeManager.getNodes(NodeManager.java:752) at helma.objectmodel.db.WrappedNodeManager.getNodes(WrappedNodeManager.j ava:57) at helma.objectmodel.db.Node.loadNodes(Node.java:1172) at helma.objectmodel.db.Node.getSubnodeAt(Node.java:923) at helma.scripting.fesi.ESNode.getProperty(ESNode.java:287) at helma.scripting.fesi.HopExtension$NodeGet.callFunction(HopExtension.j ava:193) at FESI.Data.ESObject.doIndirectCall(ESObject.java:530) at FESI.Data.ESObject.doIndirectCall(ESObject.java:527) at FESI.Data.ESObject.doIndirectCall(ESObject.java:527) at FESI.Interpreter.EcmaScriptEvaluateVisitor.visit(EcmaScriptEvaluateVi sitor.java:784) at FESI.AST.ASTCompositeReference.jjtAccept(ASTCompositeReference.java:2 6) at FESI.Interpreter.EcmaScriptEvaluateVisitor.visit(EcmaScriptEvaluateVi sitor.java:362) at FESI.AST.ASTVariableDeclaration.jjtAccept(ASTVariableDeclaration.java :26) at FESI.Interpreter.EcmaScriptEvaluateVisitor.visit(EcmaScriptEvaluateVi sitor.java:339) at FESI.AST.ASTStatement.jjtAccept(ASTStatement.java:26) at FESI.Interpreter.EcmaScriptEvaluateVisitor.visit(EcmaScriptEvaluateVi sitor.java:320) at FESI.AST.ASTStatementList.jjtAccept(ASTStatementList.java:26) at FESI.Interpreter.EcmaScriptEvaluateVisitor.evaluateFunction(EcmaScrip tEvaluateVisitor.java:161) at FESI.Interpreter.Evaluator.evaluateFunction(Evaluator.java:768) at FESI.Data.ConstructedFunctionObject.callFunction(ConstructedFunctionO bject.java:122) at FESI.Data.ESObject.doIndirectCall(ESObject.java:530) at FESI.Data.ESObject.doIndirectCall(ESObject.java:527) at helma.framework.core.RequestEvaluator.run(RequestEvaluator.java:347) at java.lang.Thread.run(Thread.java:536) 0 odbcville/test init

  • 250 odbcville/test execute java.lang.RuntimeException: Error retrieving Nodes: ResultSet is closed at helma.objectmodel.db.WrappedNodeManager.getNodes(WrappedNodeManager.j ava:61) at helma.objectmodel.db.Node.loadNodes(Node.java:1172) at helma.objectmodel.db.Node.getSubnodeAt(Node.java:923) at helma.scripting.fesi.ESNode.getProperty(ESNode.java:287) at helma.scripting.fesi.HopExtension$NodeGet.callFunction(HopExtension.j ava:193) at FESI.Data.ESObject.doIndirectCall(ESObject.java:530) at FESI.Data.ESObject.doIndirectCall(ESObject.java:527) at FESI.Data.ESObject.doIndirectCall(ESObject.java:527) at FESI.Interpreter.EcmaScriptEvaluateVisitor.visit(EcmaScriptEvaluateVi sitor.java:784) at FESI.AST.ASTCompositeReference.jjtAccept(ASTCompositeReference.java:2
  1.  at FESI.Interpreter.EcmaScriptEvaluateVisitor.visit(EcmaScriptEvaluateVi
    

sitor.java:362) at FESI.AST.ASTVariableDeclaration.jjtAccept(ASTVariableDeclaration.java :26) at FESI.Interpreter.EcmaScriptEvaluateVisitor.visit(EcmaScriptEvaluateVi sitor.java:339) at FESI.AST.ASTStatement.jjtAccept(ASTStatement.java:26) at FESI.Interpreter.EcmaScriptEvaluateVisitor.visit(EcmaScriptEvaluateVi sitor.java:320) at FESI.AST.ASTStatementList.jjtAccept(ASTStatementList.java:26) at FESI.Interpreter.EcmaScriptEvaluateVisitor.evaluateFunction(EcmaScrip tEvaluateVisitor.java:161) at FESI.Interpreter.Evaluator.evaluateFunction(Evaluator.java:768) at FESI.Data.ConstructedFunctionObject.callFunction(ConstructedFunctionO bject.java:122) at FESI.Data.ESObject.doIndirectCall(ESObject.java:530) at FESI.Data.ESObject.doIndirectCall(ESObject.java:527) at helma.framework.core.RequestEvaluator.run(RequestEvaluator.java:347) at java.lang.Thread.run(Thread.java:536)

  • 0 odbcville/test init java.lang.RuntimeException: Error retrieving Nodes: ResultSet is closed at helma.framework.core.RequestEvaluator.run(RequestEvaluator.java:225) at java.lang.Thread.run(Thread.java:536)

link  


... comment
 
hns, February 6, 2002 at 5:49:55 PM CET

Tobi

Do you have data in the db? is there a weblog object?

Can you try removing this line from root/type.properties:

_subnodes.loadmode=aggressive

Also, can you make a simple root/test.hac and tell me what you get on the following statements (issued separately):

res.write (this.size());

(and, provided there is a weblog in the db)

res.write (this.get(0));

link  

 
tobi, February 6, 2002 at 6:30:02 PM CET

here we go again

sorry for the late reply... let's see:

i have data in the db (it was successfully imported from the mysql db i used so far with the local antville installation).

i can access the data via direct db, e.g. retrieve a record from the weblog table.

this.get(0) returns the mentioned error (resultset is closed). this means, there is no weblog object.

this.size() returns 2!

after i commented out _subnodes.loadmode=aggressive:

HEY! this.get(0) returns a hopobject!

ok, after that i pointed the browser to antville's main page again and in fact got some more to see. moving forward!

however, there are still errors, apparently the odbc driver does not like the sql syntax (i assume it's the single quotes, i had to use double ones in the direct db test.hac):

[HopMacro error: java.lang.RuntimeException: Error retrieving NodeIDs: [Microsoft][ODBC Microsoft Access Driver] Syntaxfehler in FROM-Klausel.]

(obviously i am using a german treiber, mein herr. should i try the us-english one?)

link  

 
hns, February 6, 2002 at 7:01:51 PM CET

Next 2 questions

Haven't you used Helma with Access/ODBC already without any problems?

Does the database look ok when you browse it with Access?

link  

 
tobi, February 6, 2002 at 7:12:03 PM CET

noyesno

no, i haven't really used helma with access. i think we just connected a simple helma application with odbc for testing purposes one or two years ago. and i have not went any further than that.

well, yes and no. it's ok to use the database in access. but in fact it does look a little bit weird. i just noticed that not all ID fields are set to NUMBER but instead to TEXT... and the PRIMARY KEYs are not set. i am currently modifying this and will see what happens.

link  


... comment
 
tobi, February 7, 2002 at 11:28:26 AM CET

odbc & simple app

now i tested the whole thing with a totally simple application (the one described in the helma user's guide) and made the following observations:

  1. i get an object not found error when the database is empty
  2. ID columns have to be of the type TEXT(!), otherwise the odbc driver returns an "incompatible data types" error.
  3. the "resultset is closed" error occurs as soon as there is one record in the db.
  4. if i set _subnodes.loadmode = aggressive by purpose(!), reload the page and then unset the loadmode again, the resultset error disappears and i can access the objects (i assume they are in helma's cache now).
  5. at this point i was also able to modify objects (the changes are reflected in the database). did not try out to create new ones, though.
all in all, i consider using .mdb files and odbc together with helma as a rather wobbly venture (at the moment even worse than hsqldb). my intuition tells me that especially point 2 causes big problems. helma creates statements like select ID from WEBLOG where ID = '1' and obviously the jet sql syntax requires an integer (ID = 1) in the "where" clause or a TEXT type for ID in the database...?

link  

 
hns, February 7, 2002 at 11:38:14 AM CET

Thanks for the report

The id stuff is rather obvious and I think I can fix it. Point 1 and 3 are pretty mysterious, though.

link  

 
tobi, February 7, 2002 at 3:25:43 PM CET

you're welcome

obvious it might be. however, i did not think that such behaviour should give reason to change java code. well, you must know. so feel free to tell me if you need some further testing with this.

link  


... comment


The Antville Server Fund has been a great success. Thanks to everybody who contributed!
online for 8550 Days
last updated: 1/4/11, 10:22 AM
status
Youre not logged in ... Login
menu
November 2024
SunMonTueWedThuFriSat
12
3456789
10111213141516
17181920212223
24252627282930
July
recent
zfuture's house here is zfuture's
house
by zfuture (7/31/03, 2:59 AM)
i understand your concerns however,
i hardly can think of a solution. certainly, if the...
by tobi (7/29/03, 9:47 AM)
Found several more similar sites
listed This is getting to be quite a concern to...
by cobalt123 (7/27/03, 7:56 PM)
Second Post Alert on Referrer
bug livecatz I put this into "help" and now here:...
by cobalt123 (7/26/03, 7:14 PM)
well it's not easy to
find from here, anyway. think we should include a link,...
by tobi (7/24/03, 11:25 AM)
So finally I found
the helma Bugzilla - stupid me.
by mdornseif (7/24/03, 10:28 AM)
clock not that it's particularly
earthshattering but the antclock is running slow by about 15...
by kohlehydrat (7/23/03, 8:25 PM)
but blogosphere.us isn't can't really
be rated as spam can it?
by kohlehydrat (7/23/03, 8:08 PM)
More referrer spam www.webfrost.com
by Irene (7/23/03, 7:55 PM)
How to log skin names
I accessed to console?? Hi, I would like to know...
by winson (7/23/03, 4:12 PM)

Click here to get an XML version of this weblog.

Made with Antville
powered by
Helma Object Publisher