[Factor-talk] sqlite-error #21 - Library used incorrectly

2011-01-05 Thread Otoburb
Hi,

I've been trying to go through malu's factor-blog-gitutorial[1] and
I'm at commit 3e91728fd6b2021fc11d, where I should be able to at least
show the list of recent posts and create new posts.
Using the following instructions in the listener, I keep running into
a 500 error from Furnace.

USING: blog db db.sqlite http.server namespaces threads ;
 main-responder set-global
[ "blog.db"  [ 8080 httpd ] with-db ] in-thread

When I look into the http log (logs/http.server/1.log), it showed the
following errors:
[2011-01-06T01:15:32-05:00] ERROR do-request: sqlite-error
[] ERROR do-request: n  21
[] ERROR do-request: string "Library used incorrectly"

I sprinkled debug log-messages throughout the code and saw that the
problem occurs when attempting to execute select-tuples within the
page-action init quotation, specifically a problem with the
recent-posts word.
The particular code fragments (with debug log messages removed):

: recent-posts ( num -- posts )
f  >query
swap >>limit
"created_at desc" >>order
select-tuples ;

:  ( -- action )

[ 5 recent-posts "posts" set-value ] >>init
{ blog "recent-posts" } >>template ;

Executing the recent-posts word from the listener:
( scratchpad ) "blog.db"  [ 5 recent-posts ] with-db

... returns a proper result (either an empty array, or a result,
depending on whether I entered a post or not previously).

I thought that the problem might be the gitutorial, so I went and
tried to launch webapps.blogs since they seem rather similar.
In the listener, I typed the following:

( scratchpad ) "temp.db"  [  main-responder
set-global 8080 httpd ] with-db

However, this resulted in the same error in the http log. With
additional debug messages in webapps.blogs, I was able to narrow down
the issue in a similar place.
In this case, the problem occurs when the select-tuples is called
within the list-posts word.

Checking basis/db/sqlite/ffi/ffi.factor shows the "CONSTANT:
SQLITE_MISUSE  21 ! Library used incorrectly" line. Since that
seemed like a sqlite3.dll lib throwing an error, I ran "db.sqlite"
test in the listener and all of the unit tests passed.

I'm hoping it's just the way that I'm setting up the environment or
perhaps misusing with-db.
At the limit of my Factor capabilities trying to figure this out.

Further information if required:
- Factor win32-2010-12-27
- sqlite3 version 3.7.4


Thanks,
Dave

--
Learn how Oracle Real Application Clusters (RAC) One Node allows customers
to consolidate database storage, standardize their database environment, and, 
should the need arise, upgrade to a full multi-node Oracle RAC database 
without downtime or disruption
http://p.sf.net/sfu/oracle-sfdevnl
___
Factor-talk mailing list
Factor-talk@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/factor-talk


Re: [Factor-talk] Fixed several documentation

2011-01-05 Thread Slava Pestov
Thank you very much for working on Factor's documentation! Not many
people have :-)

On Wed, Jan 5, 2011 at 12:51 AM, Keita Haga  wrote:
> Hi,
>
> I've read many articles from Factor documentation during the New Year's
> vacation. Thanks to wonderful articles written by Factor developers, my
> vacation was well-spent.
>
> I fixed several documentation. Patches are available in 'doc-fixes'
> branch at https://github.com/keitahaga/factor It's mostly typo fixes.
>
> Hope that helps.
>
> Thank you,
>
> Keita
>
> --
> Learn how Oracle Real Application Clusters (RAC) One Node allows customers
> to consolidate database storage, standardize their database environment, and,
> should the need arise, upgrade to a full multi-node Oracle RAC database
> without downtime or disruption
> http://p.sf.net/sfu/oracle-sfdevnl
> ___
> Factor-talk mailing list
> Factor-talk@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/factor-talk
>

--
Learn how Oracle Real Application Clusters (RAC) One Node allows customers
to consolidate database storage, standardize their database environment, and, 
should the need arise, upgrade to a full multi-node Oracle RAC database 
without downtime or disruption
http://p.sf.net/sfu/oracle-sfdevnl
___
Factor-talk mailing list
Factor-talk@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/factor-talk


[Factor-talk] Fixed several documentation

2011-01-05 Thread Keita Haga
Hi,

I've read many articles from Factor documentation during the New Year's 
vacation. Thanks to wonderful articles written by Factor developers, my 
vacation was well-spent.

I fixed several documentation. Patches are available in 'doc-fixes' 
branch at https://github.com/keitahaga/factor It's mostly typo fixes.

Hope that helps.

Thank you,

Keita

--
Learn how Oracle Real Application Clusters (RAC) One Node allows customers
to consolidate database storage, standardize their database environment, and, 
should the need arise, upgrade to a full multi-node Oracle RAC database 
without downtime or disruption
http://p.sf.net/sfu/oracle-sfdevnl
___
Factor-talk mailing list
Factor-talk@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/factor-talk