Problems with ST/X and Solutions

PersistencyManager bug?

Postby duetto » 15. Dec 2009, 20:16

hi,

i'm using stx v542.

i'm trying to use PersistencyManager to store my application objects.

i executed
db := PersistencyManager file: 'somefile.db'.
and i got a debug window with message :
"DBFile does not understand #pathName".

i also tried using PersistencyManagerTest with method test1 and got the same error.

john cummings
duetto
 
Posts: 22
Joined: 28. Sep 2009, 02:43

Re: PersistencyManager bug?

Postby duetto » 15. Dec 2009, 20:38

i need to add that i'm working in windows xp.
duetto
 
Posts: 22
Joined: 28. Sep 2009, 02:43

Re: PersistencyManager bug?

Postby cgittinger » 17. Dec 2009, 21:37

Sorry to admit, but the DBase stuff is a wrapper for the dbm/db1.6 btree database library which is not avail. on win32 systems. This has originally only been available for unix machines and we never spent the time to port it to windows. Actually any port of any C-code to windows is pretty painful and I really hate it ! I took a look for an existing win32 port of any ndbm or similar package but was not successful (until now). However, I did find a gdbm package, which is probably not compatible in the datafile, but provides a similar functionality. I wrote a makefile, edited some header definitions and got it to work, but when I run the testCase, I get an error status as return value - so, now the real fun would begin. I do not really have much time currently to continue, but if anyone is willing to proceed, you can find the code (cvs-checkout) in:
stx/support/db/gdbm-1.8.3-cos2
and the requried changes in the DBase-class in
stx/goodies/libdbase

I checked the changes in tonight (17-dec-09), so give it a day or so to find those in our public cvs repository. Remember, it is shadowed every night from our working repository.

Claus

PS: I'll keep you informed of any success...

PPS: I'd rather have a ndbm-btree implementation written in smalltalk: first, it would be absolutely free from memory leaks and buffer overflows, second it would run on all boxes - fowever !

I forgot to mention that your concrete error is the consequence of the system's attempt to autoload the DBase class. Due to some missing header files/definitions, this load fails and the class is not loaded correctly (you should see messages on the transcript...).
cgittinger
 
Posts: 61
Joined: 12. Nov 2008, 17:05

Re: PersistencyManager bug?

Postby cgittinger » 18. Dec 2009, 17:17

I just removed the
"Notice, that this is (currently) only supported for Unix architectures."
comment in PersistencyManager - meaning that gdbm support is now also avail. for win-users.

If anyone wants to try it: there is a "libdbase.dll" to be found in the download area:
ftp://www.exept.de/download/stx/stx546/updates/win32/libstx_goodies_libdbase.dll

Of course, you can also checkout the current version via the public cvs mirror.
(You need to update "support/db" (for the gdbm-library) and "goodies/libdbase").

Claus
cgittinger
 
Posts: 61
Joined: 12. Nov 2008, 17:05

Re: PersistencyManager bug?

Postby duetto » 19. Dec 2009, 00:07

"If anyone wants to try it: there is a "libdbase.dll" to be found in the download area:
ftp://www.exept.de/download/stx/stx546/ ... bdbase.dll"

claus,

what dir does this dll need to be in? i put it in

C:\Data\Code\Smalltalk Images\STX542\stx\projects\smalltalk

this is where stx.exe and other dlls are on my machine.

after restarting stx i still get the same debug window.

do i have to rebuild a dll or change a config file?

john
duetto
 
Posts: 22
Joined: 28. Sep 2009, 02:43

Re: PersistencyManager bug?

Postby cgittinger » 20. Dec 2009, 14:15

I'd put it into "goodies/libdbase" and a copy into "projectes/smalltalk".
then, you can load it either via:
Code: Select all
Smalltalk loadPackage:'stx:goodies/libdbase'

or (in the fileBrowser) by fileing-in the dll,
or (programmatically) via
Code: Select all
Smalltalk fileIn:'libstx_goodies_libdbase.dll'

or finally, by adding it to the module-list:
Code: Select all
projects\smalltalk\modules.stx
which is consulted at cold-start.

The last will only work for non-image starts (i.e. "stx -I"), not if you resume a saved image.

regards,
Claus

PS: unless you have checked out the newest source-code, do not invoke make/bmake after you have downloaded the dll. Of course, it would be overwritten by the non-working version if you did.
cgittinger
 
Posts: 61
Joined: 12. Nov 2008, 17:05

Re: PersistencyManager bug?

Postby duetto » 20. Dec 2009, 18:41

hi claus,

got further but still got this debugger:

self is an instance of DBFile

openForReadWrite
"open/create the database for read/write"

^ self openWithAccess:#hash mode:#readwrite access:8r664 <====== unknown method

"Modified: 10.2.1997 / 14:21:20 / stefan"

john
duetto
 
Posts: 22
Joined: 28. Sep 2009, 02:43

Re: PersistencyManager bug?

Postby cgittinger » 21. Dec 2009, 19:22

John,
could you please, just to make sure that I've uploaded the correct dll (which I am pretty sure to have :? ) try a cold start without image and without autoloading (i.e. "stx -I --quick") and there, fileIn the dll "Smalltalk fileIn:'...' " or click-and-fileIn in the fileBrowser.
Then, in the browser, check DBFile to contain the "openWithAccess:mode:access:" method.

If it's not there, I have uploaded garbage.
If it is, I am even more confused, as it would mean that somehow your dll-fileIn did not work, and you had the old garbage DBFile still in your image.

Let me know.
Claus
cgittinger
 
Posts: 61
Joined: 12. Nov 2008, 17:05

Re: PersistencyManager bug?

Postby duetto » 23. Dec 2009, 18:33

the new dll works. the problem i was having was based on using v5.4.2. i had not yet moved to 5.4.6. i have since tested under 5.4.6 and it works as it should.

john
duetto
 
Posts: 22
Joined: 28. Sep 2009, 02:43


Return to Troubleshooting

Users browsing this forum: No registered users and 2 guests

Design by GB