[Pljava-dev] Best way to pass intermediate state

From: thomas at tada(dot)se (Thomas Hallgren)
To:
Subject: [Pljava-dev] Best way to pass intermediate state
Date: 2006-09-22 08:22:34
Message-ID: 45139D4A.4020002@tada.se
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pljava-dev

Take a look at whats offered by the
org.postgresql.pljava.SessionManager. It has a static method that
returns a Session object. This object can store arbitrary objects as
attributes. The difference between the Session and a normal Map, is that
the stuff stored in the Session is under transaction control. A rollback
disregards changes made since last commit. The Session object will also
allow you to add listeners for transactions and savepoints.

Kind Regards,
Thomas Hallgren

Markus Schaber wrote:
> Hi, all,
>
> Markus Schaber wrote:
>
>
>> I'm currently thinking about implementing Aggregates in pljava. What's
>> the best way to pass a complex intermediate state between the different
>> iterations and the finalizing functions?
>>
>> I'd like to avoid repeated de/re-serialization of the objects into an
>> official PostgreSQL data type due to efficiency reasons.
>>
>
> As no ideas were offered here, I'm currently thinking about saving the
> intermediate states in some kind of global hashed variable.
>
> For the cleanup work, in case the query is aborted in the middle (and so
> the finishing function is never called), is there any way I can register
> a hook that gets called on commit / rollback of the current
> (sub)transaction?
>
> Thanks,
> Markus
>
>
>
>
> ------------------------------------------------------------------------
>
> _______________________________________________
> Pljava-dev mailing list
> Pljava-dev at gborg.postgresql.org
> http://gborg.postgresql.org/mailman/listinfo/pljava-dev
>

In response to

Responses

Browse pljava-dev by date

  From Date Subject
Next Message Markus Schaber 2006-09-22 08:38:31 [Pljava-dev] readBytes() / writeBytes()
Previous Message Thomas Hallgren 2006-09-22 08:17:27 [Pljava-dev] readBytes() / writeBytes()