Re: Experiences with pl/Java

Поиск
Список
Период
Сортировка
От Welty, Richard
Тема Re: Experiences with pl/Java
Дата
Msg-id 1579549587CEA24C85CE49CE261FA5E10FD6CD48@ltischcorpx01.lti.int
обсуждение исходный текст
Ответ на Re: Experiences with pl/Java  (Edson Richter <edsonrichter@hotmail.com>)
Ответы Re: Experiences with pl/Java  (Thomas Hill <Thomas.K.Hill@t-online.de>)
Список pgsql-general
Edson Richter [edsonrichter@hotmail.com] writes:
>Em 19/11/2012 15:26, Welty, Richard escreveu:

>> PL/Java requires that the methods being directly called from PostgreSQL are static.
>> while i don't disagree with the advice, PL/Java is limited in this respect.

>:-) as I said, I know little about pl/Java... thanks for pointing this out.
>So, after calling the static method, probably inside the static methods,
>the programmer will create his/her logic. Writing this logic considering
>GC behavior would make your apps more stable.
>I would recommend to not use any Java library that keeps "caches" (ones
>like EclipseLink or Hibernate), unless you know exactly how to configure
>caches and soft/weak references - and their limitations.

i would probably recommend severely limiting what you try to do in PL/Java.

in my particular project, the overall goal was incrementally doing push updates to an Apache
Solr search engine. this entailed building xml descriptions of the update that was required,
sending it with an http request (which required untrusted pl/java), and providing a recovery & retry
mechanism in case the http request failed, which limited itself to using the provided jdbc.

i got it working and working well, but i put a lot of care into insuring that the garbage collecter
never got stressed very hard and i didn't try to do more than was strictly necessary. i'd argue
that if you find yourself wanting to use hibernate or eclipselink down in PL/Java, you should
rethink your application design.

richard


В списке pgsql-general по дате отправления:

Предыдущее
От: matt@byrney.com
Дата:
Сообщение: Re: Maintaining state across function calls
Следующее
От: Tom Lane
Дата:
Сообщение: Re: Maintaining state across function calls