[MonetDB-users] Embedded Server in Python on Windows XP

I'm running Python 2.5 on Windows XP Pro SP2.
I've successfully installed the windows binary distribution (
MonetDB5-SQL-2.16.2.msi).
I've successfully run the Python example (on the website) which connects to
the standalone server.
How do I run monetdb as an embedded server? Any advice would be
appreciated.
Thanks!

Just to clarify my last message: I would like to know how to use
Python 2.5(on Win XP) to run monetdb as an embedded server.
Thanks.
On 5/12/07, Blackie Hlasek
I'm running Python 2.5 on Windows XP Pro SP2.
I've successfully installed the windows binary distribution ( MonetDB5-SQL-2.16.2.msi).
I've successfully run the Python example (on the website) which connects to the standalone server.
How do I run monetdb as an embedded server? Any advice would be appreciated.
Thanks!

Hi Blackie, On 12-05-2007 04:40:41 -0700, Blackie Hlasek wrote:
Just to clarify my last message: I would like to know how to use Python 2.5 (on Win XP) to run monetdb as an embedded server.
MonetDB always runs in a client/server model. No true embedded version of MonetDB currently exists. A slimmed down version of MonetDB is as far as I am aware not available on the Windows platform.
On 5/12/07, Blackie Hlasek <[1]blck.hl@gmail.com> wrote:
I'm running Python 2.5 on Windows XP Pro SP2.
I've successfully installed the windows binary distribution (MonetDB5-SQL-2.16.2.msi).
I've successfully run the Python example (on the website) which connects to the standalone server.
How do I run monetdb as an embedded server? Any advice would be appreciated.
Thanks!

Hi Fabian,
Thank you for your quick reply.
I understand that MonetDB always run in a client/server model. I guess what
I'm looking for is the ability to run it in the same address space as the
client application written in Python on Win XP.
For instance, this page:
http://monetdb.cwi.nl/projects/monetdb/SQL/Documentation/A-Simple-Example.ht...
gives an example of how it's done in C. In the 2nd paragraph, it stays that
"...Upon success of this call, there will be a separate server thread
running in the same user space to handle the database requests."
I'm trying to figure out how to do the same in Python but there doesn't seem
to be much documentation. From what you're saying, I guess it's not
possible to do it in Python and/or on Windows at the moment? Could you
please clarify? That is: a) can't on Python, b) can't on Windows, or c)
can't on both?
Also, I've had a chance to take a glance at the python code and I saw the
following strange bit in CMapi.py:
class Embedded(Mapi):
def __init__(self, dbfarm = None, dbname = "demo", lang = "sql"):
try:
import monetdb
if lang == "sql":
self._Mapi__mid = monetdb.monetdb_sql(dbfarm, dbname)
except:
e, value
print(e)
if not self._Mapi__mid:
raise IOError("Creating connection structure failed")
if self.error():
raise IOError(self.error_str())
The following errors are pretty obvious:
1) Indentation is incorrect, which means that the python crashed when it
reached this section. It seems strange that while the the rest of the file
uses spaces for indentation, this particular uses tabs.
2) The "except" clause has incorrect syntax.
3) There doesn't seem to be a monetdb module to import.
I've tried to correct it on my own. I think it probably should look
something like this (please correct if I'm wrong):
class Embedded(Mapi):
def __init__(self, dbfarm = None, dbname = "demo", lang = "sql"):
try:
import monetdb
if lang == "sql":
self._Mapi__mid = monetdb.monetdb_sql(dbfarm, dbname)
except Exception, value:
print(value)
if not self._Mapi__mid:
raise IOError("Creating connection structure failed")
if self.error():
raise IOError(self.error_str())
But still, not having the monetdb module makes it a no-go....
On 5/12/07, Fabian Groffen
Hi Blackie,
On 12-05-2007 04:40:41 -0700, Blackie Hlasek wrote:
Just to clarify my last message: I would like to know how to use Python 2.5 (on Win XP) to run monetdb as an embedded server.
MonetDB always runs in a client/server model. No true embedded version of MonetDB currently exists. A slimmed down version of MonetDB is as far as I am aware not available on the Windows platform.
On 5/12/07, Blackie Hlasek <[1]blck.hl@gmail.com> wrote:
I'm running Python 2.5 on Windows XP Pro SP2.
I've successfully installed the windows binary distribution (MonetDB5-SQL-2.16.2.msi).
I've successfully run the Python example (on the website) which connects to the standalone server.
How do I run monetdb as an embedded server? Any advice would be appreciated.
Thanks!
------------------------------------------------------------------------- This SF.net email is sponsored by DB2 Express Download DB2 Express C - the FREE version of DB2 express and take control of your XML. No limits. Just data. Click to get it now. http://sourceforge.net/powerbar/db2/ _______________________________________________ MonetDB-users mailing list MonetDB-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/monetdb-users

On Sat, May 12, 2007 at 03:52:33PM -0700, Blackie Hlasek wrote: Hi Blackie, The embedded version indeed uses a thread for the server and this runs indeed in the same adress space. The client and server threads communicate using named pipes. It should be possible to use the same python module MonetSQLdb. This module depends on 2 c modules, the MapiLib and monetdb. The first should be includeded automatically. That should give you the possiblility to play with monetdb/sql in the reall client server version. The later adds the embedded version. And then you could use connect(dbfarm = "location of the dbfarm", dbname = "database name"); The problem is that the monetdb python module wasn't included in the installer. The usual solutions for this exist, compile your own version on windows, change plantform (linux is our main platform), or ask us for a windows version which includes this module (the later will atleast take until monday amsterdam time). Niels
Hi Fabian, Thank you for your quick reply. I understand that MonetDB always run in a client/server model. I guess what I'm looking for is the ability to run it in the same address space as the client application written in Python on Win XP. For instance, this page: [1]http://monetdb.cwi.nl/projects/monetdb/SQL/Documentation/A-Simple -Example.html gives an example of how it's done in C. In the 2nd paragraph, it stays that "...Upon success of this call, there will be a separate server thread running in the same user space to handle the database requests." I'm trying to figure out how to do the same in Python but there doesn't seem to be much documentation. From what you're saying, I guess it's not possible to do it in Python and/or on Windows at the moment? Could you please clarify? That is: a) can't on Python, b) can't on Windows, or c) can't on both? Also, I've had a chance to take a glance at the python code and I saw the following strange bit in CMapi.py: class Embedded(Mapi): def __init__(self, dbfarm = None, dbname = "demo", lang = "sql"): try: import monetdb if lang == "sql": self._Mapi__mid = monetdb.monetdb_sql(dbfarm, dbname) except: e, value print(e) if not self._Mapi__mid: raise IOError("Creating connection structure failed") if self.error(): raise IOError(self.error_str()) The following errors are pretty obvious: 1) Indentation is incorrect, which means that the python crashed when it reached this section. It seems strange that while the the rest of the file uses spaces for indentation, this particular uses tabs. 2) The "except" clause has incorrect syntax. 3) There doesn't seem to be a monetdb module to import. I've tried to correct it on my own. I think it probably should look something like this (please correct if I'm wrong): class Embedded(Mapi): def __init__(self, dbfarm = None, dbname = "demo", lang = "sql"): try: import monetdb if lang == "sql": self._Mapi__mid = monetdb.monetdb_sql(dbfarm, dbname) except Exception, value: print(value) if not self._Mapi__mid: raise IOError("Creating connection structure failed") if self.error(): raise IOError(self.error_str()) But still, not having the monetdb module makes it a no-go.... On 5/12/07, Fabian Groffen <[2]Fabian.Groffen@cwi.nl > wrote: Hi Blackie, On 12-05-2007 04:40:41 -0700, Blackie Hlasek wrote: > Just to clarify my last message: I would like to know how to use > Python 2.5 (on Win XP) to run monetdb as an embedded server. MonetDB always runs in a client/server model. No true embedded version of MonetDB currently exists. A slimmed down version of MonetDB is as far as I am aware not available on the Windows platform. > On 5/12/07, Blackie Hlasek <[1]blck.hl@[3]gmail.com> wrote: > > I'm running Python 2.5 on Windows XP Pro SP2. > > I've successfully installed the windows binary distribution > (MonetDB5-SQL-2.16.2.msi). > > I've successfully run the Python example (on the website) which > connects to the standalone server. > > How do I run monetdb as an embedded server? Any advice would be > appreciated. > > Thanks!
-------------------------------------------------------------------- ----- This SF.net email is sponsored by DB2 Express Download DB2 Express C - the FREE version of DB2 express and take control of your XML. No limits. Just data. Click to get it now. [4]http://sourceforge.net/powerbar/db2/ _______________________________________________ MonetDB-users mailing list [5]MonetDB-users@lists.sourceforge.net [6]https://lists.sourceforge.net/lists/listinfo/monetdb-users
On 5/12/07, Fabian Groffen <[7]Fabian.Groffen@cwi.nl> wrote:
Hi Blackie, On 12-05-2007 04:40:41 -0700, Blackie Hlasek wrote: > Just to clarify my last message: I would like to know how to use > Python 2.5 (on Win XP) to run monetdb as an embedded server. MonetDB always runs in a client/server model. No true embedded version of MonetDB currently exists. A slimmed down version of MonetDB is as far as I am aware not available on the Windows platform. > On 5/12/07, Blackie Hlasek <[1]blck.hl@ [8]gmail.com> wrote: > > I'm running Python 2.5 on Windows XP Pro SP2. > > I've successfully installed the windows binary distribution > ( MonetDB5-SQL-2.16.2.msi). > > I've successfully run the Python example (on the website) which > connects to the standalone server. > > How do I run monetdb as an embedded server? Any advice would be > appreciated. > > Thanks! ------------------------------------------------------------------ ------- This SF.net email is sponsored by DB2 Express Download DB2 Express C - the FREE version of DB2 express and take control of your XML. No limits. Just data. Click to get it now. [9]http://sourceforge.net/powerbar/db2/ _______________________________________________ MonetDB-users mailing list [10]MonetDB-users@lists.sourceforge.net [11]https://lists.sourceforge.net/lists/listinfo/monetdb-users
References
1. http://monetdb.cwi.nl/projects/monetdb/SQL/Documentation/A-Simple-Example.ht... 2. mailto:Fabian.Groffen@cwi.nl 3. http://gmail.com/ 4. http://sourceforge.net/powerbar/db2/ 5. mailto:MonetDB-users@lists.sourceforge.net 6. https://lists.sourceforge.net/lists/listinfo/monetdb-users 7. mailto:Fabian.Groffen@cwi.nl 8. http://gmail.com/ 9. http://sourceforge.net/powerbar/db2/ 10. mailto:MonetDB-users@lists.sourceforge.net 11. https://lists.sourceforge.net/lists/listinfo/monetdb-users
------------------------------------------------------------------------- This SF.net email is sponsored by DB2 Express Download DB2 Express C - the FREE version of DB2 express and take control of your XML. No limits. Just data. Click to get it now. http://sourceforge.net/powerbar/db2/ _______________________________________________ MonetDB-users mailing list MonetDB-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/monetdb-users
-- Niels Nes, Centre for Mathematics and Computer Science (CWI) Kruislaan 413, 1098 SJ Amsterdam, The Netherlands room C0.02, phone ++31 20 592-4098, fax ++31 20 592-4312 url: http://www.cwi.nl/~niels e-mail: Niels.Nes@cwi.nl

Thanks for the detailed explanation.
I've logged the request on Sourceforge:
http://sourceforge.net/tracker/index.php?func=detail&aid=1718038&group_id=56967&atid=482471
Cheers.
On 5/12/07, Niels Nes
On Sat, May 12, 2007 at 03:52:33PM -0700, Blackie Hlasek wrote:
Hi Blackie,
The embedded version indeed uses a thread for the server and this runs indeed in the same adress space. The client and server threads communicate using named pipes.
It should be possible to use the same python module MonetSQLdb. This module depends on 2 c modules, the MapiLib and monetdb. The first should be includeded automatically. That should give you the possiblility to play with monetdb/sql in the reall client server version. The later adds the embedded version. And then you could use connect(dbfarm = "location of the dbfarm", dbname = "database name");
The problem is that the monetdb python module wasn't included in the installer. The usual solutions for this exist, compile your own version on windows, change plantform (linux is our main platform), or ask us for a windows version which includes this module (the later will atleast take until monday amsterdam time).
Niels
Hi Fabian, Thank you for your quick reply. I understand that MonetDB always run in a client/server model. I guess what I'm looking for is the ability to run it in the same address space as the client application written in Python on Win XP. For instance, this page: [1]http://monetdb.cwi.nl/projects/monetdb/SQL/Documentation/A-Simple -Example.html gives an example of how it's done in C. In the 2nd paragraph, it stays that "...Upon success of this call, there will be a separate server thread running in the same user space to handle the database requests." I'm trying to figure out how to do the same in Python but there doesn't seem to be much documentation. From what you're saying, I guess it's not possible to do it in Python and/or on Windows at the moment? Could you please clarify? That is: a) can't on Python, b) can't on Windows, or c) can't on both? Also, I've had a chance to take a glance at the python code and I saw the following strange bit in CMapi.py: class Embedded(Mapi): def __init__(self, dbfarm = None, dbname = "demo", lang = "sql"): try: import monetdb if lang == "sql": self._Mapi__mid = monetdb.monetdb_sql(dbfarm, dbname) except: e, value print(e) if not self._Mapi__mid: raise IOError("Creating connection structure failed") if self.error(): raise IOError(self.error_str()) The following errors are pretty obvious: 1) Indentation is incorrect, which means that the python crashed when it reached this section. It seems strange that while the the rest of the file uses spaces for indentation, this particular uses tabs. 2) The "except" clause has incorrect syntax. 3) There doesn't seem to be a monetdb module to import. I've tried to correct it on my own. I think it probably should look something like this (please correct if I'm wrong): class Embedded(Mapi): def __init__(self, dbfarm = None, dbname = "demo", lang = "sql"): try: import monetdb if lang == "sql": self._Mapi__mid = monetdb.monetdb_sql(dbfarm, dbname) except Exception, value: print(value) if not self._Mapi__mid: raise IOError("Creating connection structure failed") if self.error(): raise IOError(self.error_str()) But still, not having the monetdb module makes it a no-go.... On 5/12/07, Fabian Groffen <[2]Fabian.Groffen@cwi.nl > wrote: Hi Blackie, On 12-05-2007 04:40:41 -0700, Blackie Hlasek wrote: > Just to clarify my last message: I would like to know how to use > Python 2.5 (on Win XP) to run monetdb as an embedded server. MonetDB always runs in a client/server model. No true embedded version of MonetDB currently exists. A slimmed down version of MonetDB is as far as I am aware not available on the Windows platform. > On 5/12/07, Blackie Hlasek <[1]blck.hl@[3]gmail.com> wrote: > > I'm running Python 2.5 on Windows XP Pro SP2. > > I've successfully installed the windows binary distribution > (MonetDB5-SQL-2.16.2.msi). > > I've successfully run the Python example (on the website) which > connects to the standalone server. > > How do I run monetdb as an embedded server? Any advice would be > appreciated. > > Thanks!
-------------------------------------------------------------------- ----- This SF.net email is sponsored by DB2 Express Download DB2 Express C - the FREE version of DB2 express and take control of your XML. No limits. Just data. Click to get it now. [4]http://sourceforge.net/powerbar/db2/ _______________________________________________ MonetDB-users mailing list [5]MonetDB-users@lists.sourceforge.net [6]https://lists.sourceforge.net/lists/listinfo/monetdb-users
On 5/12/07, Fabian Groffen <[7]Fabian.Groffen@cwi.nl> wrote:
Hi Blackie, On 12-05-2007 04:40:41 -0700, Blackie Hlasek wrote: > Just to clarify my last message: I would like to know how to use > Python 2.5 (on Win XP) to run monetdb as an embedded server. MonetDB always runs in a client/server model. No true embedded version of MonetDB currently exists. A slimmed down version of MonetDB is as far as I am aware not available on the Windows platform. > On 5/12/07, Blackie Hlasek <[1]blck.hl@ [8]gmail.com> wrote: > > I'm running Python 2.5 on Windows XP Pro SP2. > > I've successfully installed the windows binary distribution > ( MonetDB5-SQL-2.16.2.msi). > > I've successfully run the Python example (on the website) which > connects to the standalone server. > > How do I run monetdb as an embedded server? Any advice would be > appreciated. > > Thanks! ------------------------------------------------------------------ ------- This SF.net email is sponsored by DB2 Express Download DB2 Express C - the FREE version of DB2 express and take control of your XML. No limits. Just data. Click to get it now. [9]http://sourceforge.net/powerbar/db2/ _______________________________________________ MonetDB-users mailing list [10]MonetDB-users@lists.sourceforge.net [11]https://lists.sourceforge.net/lists/listinfo/monetdb-users
References
1.
http://monetdb.cwi.nl/projects/monetdb/SQL/Documentation/A-Simple-Example.ht...
2. mailto:Fabian.Groffen@cwi.nl 3. http://gmail.com/ 4. http://sourceforge.net/powerbar/db2/ 5. mailto:MonetDB-users@lists.sourceforge.net 6. https://lists.sourceforge.net/lists/listinfo/monetdb-users 7. mailto:Fabian.Groffen@cwi.nl 8. http://gmail.com/ 9. http://sourceforge.net/powerbar/db2/ 10. mailto:MonetDB-users@lists.sourceforge.net 11. https://lists.sourceforge.net/lists/listinfo/monetdb-users
-------------------------------------------------------------------------
This SF.net email is sponsored by DB2 Express Download DB2 Express C - the FREE version of DB2 express and take control of your XML. No limits. Just data. Click to get it now. http://sourceforge.net/powerbar/db2/ _______________________________________________ MonetDB-users mailing list MonetDB-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/monetdb-users
--
Niels Nes, Centre for Mathematics and Computer Science (CWI) Kruislaan 413, 1098 SJ Amsterdam, The Netherlands room C0.02, phone ++31 20 592-4098, fax ++31 20 592-4312 url: http://www.cwi.nl/~niels e-mail: Niels.Nes@cwi.nl
participants (3)
-
Blackie Hlasek
-
Fabian Groffen
-
Niels Nes