Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6984733
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T18:35:16+00:00 2026-05-27T18:35:16+00:00

I have a PostgreSQL server and I need to run some code whenever an

  • 0

I have a PostgreSQL server and I need to run some code whenever an update happens on some table. The PostgreSQL triggers (using PL/java) allows me to call a static java method. The method I need to execute does an RPC to an external server with the information about what the update was.

What I couldn’t figure out is how I can create a global resource (in this case, the network conection with the external server) which persists across calls.

One way is probably to create a static variables for the global resources. When my trigger method is called the first time, initialize those variables. In subsequent calls just use it. Will this work, and is there any other way?

What I would have loved is a general trigger interface which I could implement for my trigger.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-27T18:35:16+00:00Added an answer on May 27, 2026 at 6:35 pm

    Even if you’d do it – it would be “global” only for given session – not across many sessions.

    But – the point is moot, because, as I see it, the approach it wrong.

    Instead of adding trigger which connects to external system, I would much rather:

    1. create trigger that uses NOTIFY to inform about the change
    2. add application that LISTENs for notifications and does the remote job.
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'd need advice on following situation with Oracle/PostgreSQL: I have a db table with
I have a strange question. I need to send some code to a client
I have a Tomcat and PostgreSQL installed on a server. I'm having a connection
I have just installed PostgreSQL 8.3.4 on Mac OS X 10.5 (using ports), but
In PostgreSQL 8.3 database I have bookings table referencing booking_transactions table by ID. So
I have a table in PostgreSQL where the schema looks like this: CREATE TABLE
I also have a very large table in SQL Server (2008 R2 Developer Edition)
Hy guys, i have a postgresql 8.3 server with many database. Actually, im planning
I need to replicate data from Microsoft SQL Server to MySQL or PostgreSQL. The
I have some backend functionality which need to be written in C# (for political,

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.