agora inbox for pljava-dev@postgresql.org  
help / color / mirror / Atom feed
[Pljava-dev] Newbie Questions
2+ messages / 0 participants
[nested] [flat]

* [Pljava-dev] Newbie Questions
@ 2006-09-29 18:46 
  2006-09-29 19:12 ` [Pljava-dev] Newbie Questions 
  0 siblings, 1 reply; 2+ messages in thread

From:  @ 2006-09-29 18:46 UTC (permalink / raw)

Folks,

YES, I am a newbie.  But I have been tasked to verify several questions 
specific to the PLJava implementation (version 1.3. 0, Postgresql 
8.1+).  I have read the manual at 
http://wiki.tada.se/wiki/display/pljava/The+choice+of+JNI which has been 
most helpful and informative.  But I need to verify the following:

    1)   When I create a connection "Connection db = 
DriverManager.getConnection("jdbc:default:connection");", does this 
reuse/copy/duplicate the existing connection or does it create a new 
(second) connection to the database?

    2)    In reading the above referenced web page it appears that each 
connection has its own JVM.  Is this true, or is there a single JVM per 
schema, or a single JVM per database?

Thanks in advance for your help.

Scott.




^ permalink  raw  reply  [nested|flat] 2+ messages in thread

* [Pljava-dev] Newbie Questions
  2006-09-29 18:46 [Pljava-dev] Newbie Questions 
@ 2006-09-29 19:12 ` 
  0 siblings, 0 replies; 2+ messages in thread

From:  @ 2006-09-29 19:12 UTC (permalink / raw)

Scott Petersen wrote:
> Folks,
>
> YES, I am a newbie.  But I have been tasked to verify several questions 
> specific to the PLJava implementation (version 1.3. 0, Postgresql 
> 8.1+).  I have read the manual at 
> http://wiki.tada.se/wiki/display/pljava/The+choice+of+JNI which has been 
> most helpful and informative.  But I need to verify the following:
>
>     1)   When I create a connection "Connection db = 
> DriverManager.getConnection("jdbc:default:connection");", does this 
> reuse/copy/duplicate the existing connection or does it create a new 
> (second) connection to the database?
>
>   
Well, that depends on how you look at it. Let me elaborate:

You start with a client application. If you use Java, you will probably 
use JDBC but the same is true if you use the psql client or something 
else. This application will utilize some kind of IPC mechanism (often a 
socket) and connect your client process to the backend server process. 
The first time the backend server process executes a Java function, it 
will instantiate a JVM. If the Java method in turn uses the 
getConnection() method that you give in your example, it will establish 
an *internal* connection within the backend. Unlike the the socket 
connection, this connection is in-process, has very low overhead, and 
executes within the same transaction as the caller.


>     2)    In reading the above referenced web page it appears that each 
> connection has its own JVM.  Is this true, or is there a single JVM per 
> schema, or a single JVM per database?
>
>   
It's a single JVM per client connection. I recommend reading 
http://wiki.tada.se/wiki/display/pljava/The+choice+of+JNI for a deeper 
understanding of the choice of technology.

Kind Regards,
Thomas Hallgren





^ permalink  raw  reply  [nested|flat] 2+ messages in thread


end of thread, other threads:[~2006-09-29 19:12 UTC | newest]

Thread overview: 2+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2006-09-29 18:46 [Pljava-dev] Newbie Questions 
2006-09-29 19:12 ` 

This inbox is served by agora; see mirroring instructions
for how to clone and mirror all data and code used for this inbox