~ubuntu-branches/ubuntu/oneiric/postgresql-pljava/oneiric-201109061811

« back to all changes in this revision

Viewing changes to docs/pljava_and_posgresql_8.html

  • Committer: Bazaar Package Importer
  • Author(s): Peter Eisentraut
  • Date: 2006-06-26 10:44:55 UTC
  • mfrom: (1.1.1 upstream) (3.1.1 edgy)
  • Revision ID: james.westby@ubuntu.com-20060626104455-135i9wosat2k8vvt
Tags: 1.3.0-1
* New upstream release (closes: #375199)
* Built for postgresql 8.1 (closes: #339641)
* Rebuilt for new libgcj library (closes: #369986)
* Updated copyright file
* Updated standards version
* Made use of cdbs simple patchsys

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
<html>
2
 
 
3
 
<head>
4
 
<meta http-equiv="Content-Language" content="en-us">
5
 
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
6
 
<title>PL/Java and PosgreSQL 8</title>
7
 
</head>
8
 
 
9
 
<body>
10
 
 
11
 
<h1>PL/Java and PostgreSQL 8.0</h1>
12
 
<p><font size="2">Java&#8482; is a registered trademark of Sun Microsystems, Inc. in the United States and other countries.</font></p><br/>
13
 
<p>PostgreSQL introduces a couple of new features that PL/Java make use of.</p>
14
 
<h2>Exception handling</h2>
15
 
<p>It is now possible to catch and handle an exception in the Postgres backend. 
16
 
While it was possible to catch an exception in earlier Postgres versions as 
17
 
well, there was no way to prevent the generated message from being printed, nor 
18
 
to find out what the error was. The nested transaction concept introduced with 
19
 
8.0 forced this to change and Postgres introduced a try/catch system and a 
20
 
structure called <code>ErrorData</code> that can be used when investigating the 
21
 
cause of an exception. PL/Java fully exploits this. The <code>ErrorData</code> is 
22
 
exposed as a property in a class called <code>
23
 
org.postgresql.pljava.ServerException</code> (derived from
24
 
<code>java.sql.SQLException</code>) and the Java try/catch mechanism is 
25
 
synchronized with the backend mechanism.</p>
26
 
<h2>Savepoints</h2>
27
 
PostgreSQL savepoints are exposed using the <code>java.sql.Connection</code>
28
 
interface. Two restrictions apply.<ul>
29
 
<li>A savepoint must be rolled back or released in the function where it was 
30
 
set.</li>
31
 
<li>A savepoint must not outlife the function where it was set</li>
32
 
</ul>
33
 
<h2>Module configuration.</h2>
34
 
<p>Postgres 8.0 introduces the concept of <i>custom variable classes</i> in the
35
 
<code>postgresql.conf</code> configuration file to enable modules like PL/Java to 
36
 
add their own configuration parameters. Normally, any variable name that the 
37
 
postmaster cannot recognize will generate an error. Now, with a custom variable 
38
 
class, a module can add a class of variables that the postmaster will accept. 
39
 
It's then up to the module to verify their correctness.</p>
40
 
<p>Please note that custom variables can be set using the SQL SET command also, 
41
 
just like most other variables.</p>
42
 
<p>PL/Java introduces a custom variable class named &quot;pljava&quot; and some variables. 
43
 
Here's a sample postgresql.conf entry using all (3) of the variables currently 
44
 
introduced:</p>
45
 
<pre># define &quot;pljava&quot; as a custom variable class. This is a comma separated
46
 
# list of names.
47
 
#
48
 
custom_variable_classes = 'pljava'
49
 
 
50
 
# define the class path that the JVM will use when loading the
51
 
# initial library. Only meaningful for non GJC installations
52
 
#
53
 
pljava.classpath = '/home/Tada/pljava/build/pljava.jar'
54
 
 
55
 
# Set the size of the prepared statement MRU cache
56
 
#
57
 
pljava.statement_cache_size = 10
58
 
 
59
 
# If true, lingering savepoints will be released on function exit. If false,
60
 
# the will be rolled back
61
 
#
62
 
pljava.release_lingering_savepoints = true
63
 
 
64
 
# Define startup options for the Java VM.
65
 
#
66
 
pljava.vmoptions = '-Xmx64M'
67
 
 
68
 
# Setting debug to true will cause the postgres process to go
69
 
# into a sleep(1) loop on its first call to java. This is
70
 
# only useful if you want to debug the PL/Java internal C code.
71
 
#
72
 
pljava.debug = false</pre>
73
 
 
74
 
</body>
75
 
 
76
 
</html>
 
 
b'\\ No newline at end of file'