Re: implemention of calls to stored procs.

Nic Ferrier <nferrier@tapsellferrier.co.uk>

From: Nic Ferrier <nferrier@tapsellferrier.co.uk>
To: Doug McNaught <doug@wireboard.com>
Cc: pgsql-general@postgresql.org
Date: 2002-01-23T02:27:49Z
Lists: pgsql-general
Doug McNaught <doug@wireboard.com> writes:

> Nic Ferrier <nferrier@tapsellferrier.co.uk> writes: 
>  
> > It's not terribly difficult to crack this actually... I was going to 
> > use GCJ as a platform for a base java class that could be used like a 
> > quick C stored proc. 
>  
> Interesting approach.  The other person that posted recently was going 
> to run Java as a separate daemon, since the idea of linking postgres 
> with the JVM was causing loud gagging sounds among the members of this 
> list (for reasons I agree with). 
>  
> Are you talking about Java compiled to native code rather than 
> bytecode?  I know GCJ can do that and it would seem to be a better way 
> to do this (since you can already link in native compiled C 
> libraries).   

Yes. But that's just the start. PostgreSQL can link in shared
librarys, GCJ can make shared librarys from java source code (and more
importantly from a combination of java and C++ source code!).

But once it's doing that it should be possible to get GCJ to load
class files as well (because GCJ can do that).


> The other thing to be aware of is that, if GCJ requires linking with 
> thread libraries, you may have some problems, since the PG backend 
> itself is not threaded--I'm not sure I'd want a threaded library call 
> running in a non-thread-aware app. 

GCJ doesn't require thread libs, you can build with no-threads.

Also, I have to admit that I'm not sure how a compiled lib works in
terms of threads, whether it starts a new (real) thread only when the
java code wants to start a new thread or whether it forks into a new
thread straight away. I suspect the former (easy enough to find out on
linux though).


Anyway, should be a laugh!


Nic