agora inbox for pljava-dev@postgresql.org  
help / color / mirror / Atom feed
Subject: [Pljava-dev] Transaction & java session
Date: Sat, 15 Oct 2005 21:40:09 +0200
Message-ID: <43515B18.4060409@tigris.org> (raw)
In-Reply-To: <43469BDF0001CE1D@mail-2.mail.tiscali.sys>
References: <43469BDF0001CE1D@mail-2.mail.tiscali.sys>


rcolmegna at tiscali.it wrote:
> Hi,
>
> there is some method to simulate a java-session related to a transaction?
>
> In other word: the trigger call is excecuted against static class-method.
> There
> is any way to detect that the call come from a given session and route it
> to the
> same instance of a given object?
>   
There is always an implicit session. The current Session can be obtained 
with

Session current = SessionManager.current();

This session maps to the PostgreSQL session, i.e. the backend process 
that PL/Java currently executes in. The duration of this session is 
longer than the duration of a transaction.
> And ... another question: the only wait from PLJAVA to force a 
> rollback is
> to execute
> a referential-broken INS/UPD?
>   
The easiest way to cause a rollback is to simply throw an SQLException.

Regards,
Thomas Hallgren





view thread (2+ messages)

Message-ID: <43515B18.4060409@tigris.org>
Permalink:  ../43515B18.4060409@tigris.org/
Also on:    postgresql.org/message-id/43515B18.4060409@tigris.org

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pljava-dev@postgresql.org
  Subject: Re: [Pljava-dev] Transaction & java session
  In-Reply-To: <43515B18.4060409@tigris.org>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

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