[Pljava-dev] PL/Java functions and JDBC

Lists: pljava-dev
From: p(dot)peisker at web(dot)de (Patrick Peisker)
To:
Subject: [Pljava-dev] PL/Java functions and JDBC
Date: 2006-02-22 17:46:06
Message-ID: 802896981@web.de
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pljava-dev

Hi,

I hope that mail does not appear two times in the list ...

After testing PL/Java and multithreading, I try something different. My scenario:

- A PL/Java trigger is called before an update is exceuted on a table. This trigger writes something into a queue (singelton pattern)

- A PL/Java function is called from an external application using JDBC. This function should read data from the queue and do something with it

No Problems with:

- Write and read data from the queue

- Call the PL/Java function from the pgAdmin III query tool

Problems:

- If the PL/Java function is called using JDBC (statement.execute("select functionName();")), the queue is always empty (???)

Any ideas what to do?

thx la lot,

Patrick

______________________________________________________________
Verschicken Sie romantische, coole und witzige Bilder per SMS!
Jetzt bei WEB.DE FreeMail: http://f.web.de/?mc=021193


From: thomas at tada(dot)se (Thomas Hallgren)
To:
Subject: [Pljava-dev] PL/Java functions and JDBC
Date: 2006-02-22 17:51:48
Message-ID: 43FCA4B4.5010504@tada.se
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: PostgreSQL : PostgreSQL 메일 링리스트 : 2006-02-22 이후 스포츠 토토 결과Dev 17:51

Patrick,
I'm not sure this is your problem, but each connection uses it's own
JVM. So if you use one connection to populate an in-memory queue,
there's no way you can read that queue from another connection. The only
way to accomplish that is to use a persistent queue.

Regards,
Thomas Hallgren

Patrick Peisker wrote:
> Hi,
>
> I hope that mail does not appear two times in the list ...
>
> After testing PL/Java and multithreading, I try something different. My scenario:
>
> - A PL/Java trigger is called before an update is exceuted on a table. This trigger writes something into a queue (singelton pattern)
>
> - A PL/Java function is called from an external application using JDBC. This function should read data from the queue and do something with it
>
> No Problems with:
>
> - Write and read data from the queue
>
> - Call the PL/Java function from the pgAdmin III query tool
>
> Problems:
>
> - If the PL/Java function is called using JDBC (statement.execute("select functionName();")), the queue is always empty (???)
>
>
> Any ideas what to do?
>
> thx la lot,
>
> Patrick
>
> ______________________________________________________________
> Verschicken Sie romantische, coole und witzige Bilder per SMS!
> Jetzt bei WEB.DE FreeMail: http://f.web.de/?mc=021193
>
> _______________________________________________
> Pljava-dev mailing list
> Pljava-dev at gborg.postgresql.org
> http://gborg.postgresql.org/mailman/listinfo/pljava-dev
>