[Pljava-dev] Best way to pass intermediate state

Thomas Hallgren thomas at tada.se
Fri Sep 22 08:22:34 UTC 2006


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
>   




More information about the Pljava-dev mailing list