If that's really what you want to do then I think something along the
lines of keeping the DB in the C++ program and then using a named pipe
or socket to do the inter-processes communication between the java and
C++ programs is the way to go. - or some CORBA/SOAP like wrapper to do
the remote function call between the two processes. (at the end of the
day both CORBA and SOAP are RPC over a socket-ed connection using XML or
similar to serialise the function call / return over the socket with
varying degrees of assistance from the supporting framework).

Using JNI to call to/from the C++ is probably not the best route to
achieve what you want since you want two separate processes accessing
the same in-memory database. (and it has a reputation for being quite
painful to implement)

Essentially you're wanting to mimic a client - server situation, so
maybe the way to go is take once of these client server
implementations...
http://www.sqlite.org/cvstrac/wiki?p=SqliteNetwork

and create/ modify a SQLite JDBC driver so that speaks the same protocol
as one of the above ?..... (he says in blissful ignorance of any of the
implementation details of any of the sqlite JDBC drivers so I don't know
what the practicalities are.)

cheers
Owen





-----Original Message-----
From: sqlite-users-boun...@sqlite.org
[mailto:sqlite-users-boun...@sqlite.org] On Behalf Of Serdar Genc
Sent: Wednesday, November 04, 2009 12:57 PM
To: j...@kreibi.ch; General Discussion of SQLite Database
Subject: Re: [sqlite] in-memory database concept

Yes I am aware of that but I need to access an in-memory database from
two
processes which were written in Java and C++.
I am just looking for a way to do so..

On Wed, Nov 4, 2009 at 2:50 PM, Jay A. Kreibich <j...@kreibi.ch> wrote:

> On Wed, Nov 04, 2009 at 10:27:57AM +0200, Serdar Genc scratched on the
> wall:
>
> > But when I try to do this for in-memory, everything is getting
chunky. A
> new
> > database is being created in memory for every attempt to open
> > database in memory. Now I am trying to switch the database handler
> between
> > C++ and Java. It requires some efforts.
>
>   Yes, that's how it is supposed to work.  A ":memory:" database can
>  only be accessed by the database handle that created it.  They're not
>  designed to be shared.
>
>  http://www.sqlite.org/inmemorydb.html
>
>   -j
>
> --
> Jay A. Kreibich < J A Y  @  K R E I B I.C H >
>
> "Our opponent is an alien starship packed with atomic bombs.  We have
>  a protractor."   "I'll go home and see if I can scrounge up a ruler
>  and a piece of string."  --from Anathem by Neal Stephenson
> _______________________________________________
> sqlite-users mailing list
> sqlite-users@sqlite.org
> http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users
>
_______________________________________________
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users
_______________________________________________
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users

Reply via email to