[Pljava-dev] Transaction & java session

From: thhal at tigris(dot)org (Thomas Hallgren)
To:
Subject: [Pljava-dev] Transaction & java session
Date: 2005-10-15 19:40:09
Message-ID: 43515B18.4060409@tigris.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pljava-dev


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

In response to

Browse pljava-dev by date

  From Date Subject
Next Message Rakesh Vidyadharan 2005-10-17 17:38:57 [Pljava-dev] Passing custom java object to PL/Java
Previous Message rcolmegna at tiscali.it 2005-10-15 16:29:38 [Pljava-dev] Transaction & java session