Re: [sqlite] Using Sqlite 3.2.1 on linux

2006-07-13 Thread Nemanja Corlija

On 7/13/06, zze-ContentLab MARTINEAU Y ext RD-SIRP-REN
<[EMAIL PROTECTED]> wrote:

I tried with the last version but I still have the same problems.

I'm not sure that the appropriated version of sqlite API is used in my 
application


To find out which version of SQLite your application is linked
against, execute this query from your app:

SELECT sqlite_version();

--
Nemanja Corlija <[EMAIL PROTECTED]>


RE: [sqlite] Using Sqlite 3.2.1 on linux

2006-07-13 Thread zze-ContentLab MARTINEAU Y ext RD-SIRP-REN
I tried with the last version but I still have the same problems.

I'm not sure that the appropriated version of sqlite API is used in my 
application, because I have the following message when I run sudo make install :


PATH="$PATH:/sbin" ldconfig -n /usr/local/lib
--
Libraries have been installed in:
   /usr/local/lib

If you ever happen to want to link against installed libraries
in a given directory, LIBDIR, you must either use libtool, and
specify the full pathname of the library, or use the `-LLIBDIR'
flag during linking and do at least one of the following:
   - add LIBDIR to the `LD_LIBRARY_PATH' environment variable
 during execution
   - add LIBDIR to the `LD_RUN_PATH' environment variable
 during linking
   - use the `-Wl,--rpath -Wl,LIBDIR' linker flag

See any operating system documentation about shared libraries for
more information, such as the ld(1) and ld.so(8) manual pages.
--


Do you think I should set an LD_LIBRARY_PATH environment variable ?



 

-Message d'origine-
De : [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] 
Envoyé : jeudi 13 juillet 2006 13:48
À : sqlite-users@sqlite.org
Objet : Re: [sqlite] Using Sqlite 3.2.1 on linux

"zze-ContentLab MARTINEAU Y ext RD-SIRP-REN" <[EMAIL PROTECTED]> wrote:
> Here is what I have been told regarding the application:
> 
> "A newer version of sqlite3-dev ( > 3.2.1) would not work. This 
> problem = is due to SQL requests threading. Newer versions force user 
> to open a = new connection for each Thread. We did not take the time 
> to adapt our = code."
> 

They have that backwards.  Older versions do not allow database connections to 
be passed across threads due to bugs in Linux.  There is a work-around for that 
bug beginning in version 3.3.1.

You should use the latest release.
--
D. Richard Hipp   <[EMAIL PROTECTED]>



Re: [sqlite] Using Sqlite 3.2.1 on linux

2006-07-13 Thread drh
"zze-ContentLab MARTINEAU Y ext RD-SIRP-REN" <[EMAIL PROTECTED]> wrote:
> Here is what I have been told regarding the application:
> 
> "A newer version of sqlite3-dev ( > 3.2.1) would not work. This problem =
> is due to SQL requests threading. Newer versions force user to open a =
> new connection for each Thread. We did not take the time to adapt our =
> code."
> 

They have that backwards.  Older versions do not allow
database connections to be passed across threads due to
bugs in Linux.  There is a work-around for that bug
beginning in version 3.3.1.

You should use the latest release.
--
D. Richard Hipp   <[EMAIL PROTECTED]>



RE: [sqlite] Using Sqlite 3.2.1 on linux

2006-07-13 Thread zze-ContentLab MARTINEAU Y ext RD-SIRP-REN
Here is what I have been told regarding the application:

"A newer version of sqlite3-dev ( > 3.2.1) would not work. This problem is due 
to SQL requests threading. Newer versions force user to open a new connection 
for each Thread. We did not take the time to adapt our code."

That's true, it does not mention any difference in the API, but in the way to 
use it.
Do you think I should try with the last version nevertheless ?

Thank you for your answear.

yohann
 

-Message d'origine-
De : [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] 
Envoyé : jeudi 13 juillet 2006 12:50
À : sqlite-users@sqlite.org
Objet : Re: [sqlite] Using Sqlite 3.2.1 on linux

"zze-ContentLab MARTINEAU Y ext RD-SIRP-REN" <[EMAIL PROTECTED]> wrote:
> 
> I have to use sqlite 3.2.1 with an application (newer version of 
> thread usage is not supported in the code).

Huh?  What changed with the way SQLite uses threads?
--
D. Richard Hipp   <[EMAIL PROTECTED]>



Re: [sqlite] Using Sqlite 3.2.1 on linux

2006-07-13 Thread drh
"zze-ContentLab MARTINEAU Y ext RD-SIRP-REN" <[EMAIL PROTECTED]> wrote:
> 
> I have to use sqlite 3.2.1 with an application (newer version of thread
> usage is not supported in the code). 

Huh?  What changed with the way SQLite uses threads?
--
D. Richard Hipp   <[EMAIL PROTECTED]>



[sqlite] Using Sqlite 3.2.1 on linux

2006-07-13 Thread zze-ContentLab MARTINEAU Y ext RD-SIRP-REN
Hello,

I have to use sqlite 3.2.1 with an application (newer version of thread
usage is not supported in the code). I would like to use it on an ubuntu
6.06 server distribution of linux.

I must enable threads usage, so I added the --enable-threads to the
configure script.
This script gives a warning, and I think this warning can be the cause
of my problem.
Here is its content :

checking for building with threads... yes (default)
configure: WARNING:
--enable-threads requested, but building against a Tcl that is NOT
thread-enabled.  This is an OK configuration that will also run in
a thread-enabled core.

Before running this configure script, I added tcl to my distribution
(sudo apt-get install tcl8.0).

To avoid this warning I tried to add the tclthread package for ubuntu,
but it changes nothing.

The end of the configuration is OK and the compilation works fine, but
when I access to the database via the api, I always have an error.

Here is my code :

int _sqlutil_exec(char * SQL) {
  char * err;
  int rc;

  pthread_mutex_lock(_mutex);
  rc = my_sqlite3_exec(NMdatabase, SQL, NULL, NULL, );
  pthread_mutex_unlock(_mutex);

  if (rc != SQLITE_OK) {
debug_msg( NM_DEBUG_ERROR, "ERROR - sqlutil_exec \n %s\n %s", err,
SQL);
return -1;
  }

  return 0;

};

And here is my error message :

13-Jul-06 13:57:30: ERROR - sqlutil_exec
 library routine called out of sequence
 UPDATE servers SET state = -1 WHERE id="uuid:00:0C:76:7A:B8:3E";

The result code is 134810728, but it increases for subsequent requests.
I don't think this is a hint, but we never know...

If you already have this problem or if you can help me, I would really
appreciate.

Thanks,

yohann