Antville Project

hsqldb & antville

works fine now with the patched jar library (thanks a lot, hannes). however, the antville-hsql.sql dump contains alter table statements hsql does nut support. that's why currently the antville images are not displayed even after a successful configuration of antville with hsqldb.

how could this be resolved? create the IMAGE table with ID auto_increment initially and leave it that way? or will this interfere with helma's way to determine the next ID?

comment    

 
hns, May 13, 2002 at 1:02:45 PM CEST

Ah

this should be easy to solve because primary keys are always auto-increment in hsqldb - that is, in insert statements that don't have an explicit primary key, it should be set/incremented automatically. So it should be possible to just leave those two lines away...

But thinking a bit further, I think the real problem may be that the createTables script only executes the CREATE statements because it explicitly picks them out from the sql file.

Anyway, it may be a good idea to improve the table creation script and create the tables by some internal function (like onStart()) rather than a .hac file. I think this could be done by using a tryEval() that accesses some table and create the tables if an error was thrown. It would also make it possible to directly embed the SQL statements in the code rather then to read them from an external file like createTables.hac does.

link  

 
tobi, May 13, 2002 at 1:11:08 PM CEST

not quite

the next error occurs when trying to insert a new record into IMAGE: Try to insert null into a non-nullable column in statement [insert into IMAGE (ALIAS,FILENAME,FILEEXT,WIDTH,HEIGHT,ALTTEXT) values ('big','big','gif',404,53,'antville.org'); ].

+1 for integrating the sql statements as you proposed.

link  

 
hns, May 13, 2002 at 1:13:00 PM CEST

try

leaving away the "not null" from the create statement.

link  

 
tobi, May 13, 2002 at 1:16:23 PM CEST

step by step

ok, leaving away "not null" got me successfully inserting the first record into IMAGE but then i get the error in the next line: Violation of unique index in statement [insert into IMAGE (ALIAS,FILENAME,FILEEXT,WIDTH,HEIGHT,ALTTEXT) values ('smallanim','smallanim','gif',98,30,'resident of antville.org');]

link  

 
hns, May 13, 2002 at 1:22:21 PM CEST

Contradicts what the hsqldb docs say

so I think you should consult hsqldb mailing lists on that. Maybe you can/should set auto-increment in 1.7 after all.

Or wait ... maybe it's Village throwing the exception. That's quite possible. Do you get a stack trace that tells you where the exceptions are thrown?

link  

 
hns, May 13, 2002 at 1:37:39 PM CEST

Anyway

no need to go head-through-wall if we can use the door... since we are creating this from within Helma, we should be able to create images as normal HopObjects, using the new Image(..) constructor.

link  

 
tobi, May 13, 2002 at 1:53:29 PM CEST

solution

ok, i found something: hsqldb is using a property called identity to make a column auto-incremented.

adding this to the create statement [create table IMAGE (ID int(9) identity primary key, ...] results in success when inserting the records.

however, could this cause confusion with helma's internal way to determine IDs?

link  

 
tobi, May 13, 2002 at 2:03:41 PM CEST

RE: Anyway

i am not sure if i understand what you're up to, maybe you could help me a little bit with an example.

what about putting the antville.* files generated by hsqldb into the cvs skeleton? this way we would have all necessary data provided...?

link  

 
hns, May 13, 2002 at 2:39:35 PM CEST

I meant

creating the standard image objects from within the antville application as HopObjects (since we're creating the tables from within the antville application anyway).

Yes on including the antville.* files, but there should be a way to recreate them in case people want to start over or whatever.

link  


... comment
 
tobi, May 13, 2002 at 3:13:52 PM CEST

next thing to fix

hsqldb obviously does not support aliases (using "as"). that means, the query to display referrers (also backlinks) is not working:

Unexpected token: COUNT in statement [select , count() as COUNT from ACCESS where WEBLOG_ID = 1 and DATE > NOW()-1000000 group by REFERRER order by COUNT desc, REFERRER asc;]

is there a way to modify this query that it works with hsqldb?

update: i think COUNT is troublesome because it sounds like a reserved word... still diggin'

link  

 
tobi, May 13, 2002 at 3:36:54 PM CEST

quotes

okay, if i put COUNT in quotes hsqldb can do it. however, i do get a single row returned (full of null values) when there is no result set:

ID: null WEBLOG_ID: null STORY_ID: null REFERRER: null IP: null BROWSER: null DATE: null COUNT: 0

probably due to COUNT being 0, not null...?

link  


... comment
 
tobi, May 13, 2002 at 4:28:36 PM CEST

babap, i'm stuck...

hsqldb already does not like the query in logAccess():

Column not found: http://localhost:8080/antville/hsqldb in statement [insert into ACCESS (WEBLOG_ID, STORY_ID, REFERRER, IP, BROWSER, DATE) values (1, 2, "localhost:8080", "127.0.0.1", "Mozilla/4.0 (compatible; MSIE 5.5; Windows NT 5.0)", now());]

hoboken knows why it tries to look for a column named with the value that should be added...?!?

link  

 
tobi, May 13, 2002 at 4:44:54 PM CEST

first guess

it's a wrong datatype (it worked with a number). nope, it were missing single 'quotes'.

link  

 
tobi, May 13, 2002 at 5:54:19 PM CEST

phew

that's quite some hard work, but fortunately the referrers now seem to work with hsqldb. i just have to re-check if mysql still works with the new code.

link  

 
tobi, May 13, 2002 at 6:45:22 PM CEST

looks ok

tomorrow i will make some more tests and hopefully hsqldb will be able to do everything what mysql already does...

already now i can tell that hsqldb gives us trouble with the current referrer query when the ACCESS table or the record set is empty (as already posted).

any idea how to solve 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