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

* [Pljava-dev] Questions about pl/java
@ 2006-04-05 02:03 
  2006-04-05 07:10 ` [Pljava-dev] Questions about pl/java 
  2006-04-05 12:18 ` [Pljava-dev] Questions about pl/java 
  0 siblings, 2 replies; 4+ messages in thread

From:  @ 2006-04-05 02:03 UTC (permalink / raw)

Hello,

I am new to pl/java and have some basic questions.  But before the
questions, a bit about my setup.  We are in the process of migrating all of
our databases from 7.3.4 to 8.1.1.  When this is done, we will have all of
our database servers on RH AS 4.0 with PG 8.1.1.

1.  Is anyone using pl/java in this type of environment.

2.  Is anyone using pl/java in a production environment?  If so, how long
have you been using it in production.

3.  Do the developers of pl/java consider it production quality?

4.  Can the pl/java be used to communicate across databases?

5.  How different is writing in pl/java versus writing application/web java
programs?

6.  Are the any limitations or major pluses on what pl/java can do versus
pl/pgsql?

Sorry for all of the questions, but I was told late today that I have a
meeting first thing in the morning to discuss implementing much of our
application logic inside our databases.  While I personally love the idea, I
need to have all of the options on the table.  Since we are a cobol and java
shop (don't ask :) ) I am looking at pl/pgsql or pl/java for the procedure
language.  I can write code in pl/pgsql, but would require training the rest
of our shop.  Obviously, I have people in the shop who are good java
programmers and could help spread the load.

Thanks so much for any information you can provide me.  I am looking at the
documentation, but I am a small time crunch.

Chris
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.pgfoundry.org/pipermail/pljava-dev/attachments/20060404/364970f0/attachment.html;



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

* [Pljava-dev] Questions about pl/java
  2006-04-05 02:03 [Pljava-dev] Questions about pl/java 
@ 2006-04-05 07:10 ` 
  2006-04-05 08:59   ` [Pljava-dev] Questions about pl/java 
  1 sibling, 1 reply; 4+ messages in thread

From:  @ 2006-04-05 07:10 UTC (permalink / raw)

Hi Chris,
Some answers from the 'developers of pl/java' side.


Chris Hoover wrote:
 > Hello,
 >
 > I am new to pl/java and have some basic questions.  But before the
 > questions, a bit about my setup.  We are in the process of migrating all
 > of our databases from 7.3.4 to 8.1.1.  When this is done, we will have
 > all of our database servers on RH AS 4.0 with PG 8.1.1.
 >
If your migration hasn't been done yet, I'd seriously consider using PG 
8.1.3 (the latest release). See:

http://www.postgresql.org/about/news.476
http://www.postgresql.org/about/news.456

 > 3.  Do the developers of pl/java consider it production quality?
 >
Yes, but as with every OSS known that I know of, there's a disclaimer in 
the license agreement (standard BSD) that might be worth reading (the 
upper cased part): http://wiki.tada.se/display/pljava/PLJava+License

 > 4.  Can the pl/java be used to communicate across databases?
 >
Yes. PL/Java is particularly well suited for this since you can register 
listeners that get notified when a transaction commits or rolls back. 
The Java runtime, with it's extensive Socket I/O capabilities, is an 
excellent platform to build this kind of things on.

 > 5.  How different is writing in pl/java versus writing application/web
 > java programs?
 >
Well, Java is Java. PL/Java is no different in that respect. There are 
two major things to consider when implementing code for PL/Java:
1. PL/Java code is executed "inside" of transaction, i.e. no commit nor 
rollback available.
2. Code is isolated to one single session, i.e. you can never share data 
with other sessions.

 > 6.  Are the any limitations or major pluses on what pl/java can do
 > versus pl/pgsql?
 >
## The major pluses: ##

** Base your code on the Java Runtime packages
The Java runtime includes XML-parsers, Networking, Collections, Logging, 
and a lot of other things that make life easy for a programmer.

** Use Open Source libraries in your code
If you lack something in hte Java Runtime, chances are high you'll find 
it in an Open Source product that can be downloaded and installed.

** Develop the code using your favorite IDE
Very advanced (and free) Interactive Development Environments

** Source line debugging
Attach to a PL/Java enabled session using the standard java debugger or 
the more advanced debugger that comes with your IDE.

** Managed complexity
Divide your code into classes, interfaces, packages, and different 
projects. Create extensive and complex logic.

** Code Reuse
Reuse utility classes that is used in other parts or your application

** Compatibility
The code that you write will be very easy to port to other databases 
that support Java stored procedures, functions, and triggers.

** All other advantages using a OO language



## Limitations: ##

** Resource demanding
At present, each session that uses PL/Java will instantiate it's own 
JVM. While this has advantages such as very low call overhead and an 
extremely high level of isolation, it has drawbacks such as high memory 
consumption and a long startup time. PL/Java performs best when it is 
used in conjunction with a connection pool. I would not recommend 
PL/Java if you expect a high number of fairly short-lived connections.

I'm working on complementing PL/Java with a solution where all sessions 
share a remote JVM. The call overhead will increase but memory 
consumption and startup times will decrease significantly. I expect both 
types of solutions to be in the product. And no, sorry, no time estimate 
for that.

** Overly complex for very simple tasks
Java code needs to be compiled, packaged in a jar file, and installed 
into the database. pgsql code is embedded in the function declaration.

** Project stability
PL/Java is young, not that widespread, and maintained by a few outside 
of the PostgreSQL core project. PL/pgsql is the opposite on all counts.

 > Thanks so much for any information you can provide me.  I am looking at
 > the documentation, but I am a small time crunch.
 >
Aren't we all ;-)

Kind Regards,
Thomas Hallgren





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

* [Pljava-dev] Questions about pl/java
  2006-04-05 02:03 [Pljava-dev] Questions about pl/java 
  2006-04-05 07:10 ` [Pljava-dev] Questions about pl/java 
@ 2006-04-05 08:59   ` 
  0 siblings, 0 replies; 4+ messages in thread

From:  @ 2006-04-05 08:59 UTC (permalink / raw)

Hi all,

I would like to put some comments to Chris's questions...

****
2.  Is anyone using pl/java in a production environment?  If so, how long 
have you been using it in production.
****

Yes, we do. We have implemented a universal data warehouse based on 
PostgreSQL and PL/Java. It has been running in a production environment for 
about half a year, with no problems reported. I love this solution, becase 
of all the reasons Thomas has already mentioned (complexity, easy 
developement using IDE (Eclipse in our case) and many many more...)

> ## Limitations: ##
> ** Overly complex for very simple tasks
> Java code needs to be compiled, packaged in a jar file, and installed
> into the database. pgsql code is embedded in the function declaration.
>

Yes, this is true, but it can also be solved. Users of our data warehouse 
can configure its behaviour by writing small pieces of Java code (plugins) 
directly into the database. Once you install "tools.jar" into your database, 
you can implement a database function (written in pl/java of course) for 
compiling and installing Java procedures on-the-fly if you wish (the same 
idea like Oracle Java Sources).

Filip

PS: Thomas, do you plan fixing the getTime() bug?





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

* [Pljava-dev] Questions about pl/java
  2006-04-05 02:03 [Pljava-dev] Questions about pl/java 
@ 2006-04-05 12:18 ` 
  1 sibling, 0 replies; 4+ messages in thread

From:  @ 2006-04-05 12:18 UTC (permalink / raw)


On 04-Apr-06, at 9:03 PM, Chris Hoover wrote:

> Hello,
>
> I am new to pl/java and have some basic questions.  But before the  
> questions, a bit about my setup.  We are in the process of  
> migrating all of our databases from 7.3.4 to 8.1.1.  When this is  
> done, we will have all of our database servers on RH AS 4.0 with PG  
> 8.1.1.
>
> 1.  Is anyone using pl/java in this type of environment.
>
> 2.  Is anyone using pl/java in a production environment?  If so,  
> how long have you been using it in production.

We have deployed an application entirely based upon PL/Java for  
database access.  Although the application was delivered 6 months ago  
to our client (a group of educational institutions), it went into  
production use only 3 months ago.  So far, there has been no bug  
reports related to PL/Java or database use.

>
> 3.  Do the developers of pl/java consider it production quality?
>
> 4.  Can the pl/java be used to communicate across databases?
>
> 5.  How different is writing in pl/java versus writing application/ 
> web java programs?

The best part of PL/Java is that you can easily migrate your JDBC  
code from your business logic to the database (PL/Java) or vice-versa.

Rakesh




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


end of thread, other threads:[~2006-04-05 12:18 UTC | newest]

Thread overview: 4+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2006-04-05 02:03 [Pljava-dev] Questions about pl/java 
2006-04-05 07:10 ` 
2006-04-05 08:59   ` 
2006-04-05 12:18 ` 

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