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 513695
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 13, 20262026-05-13T07:26:55+00:00 2026-05-13T07:26:55+00:00

Generally We have some business logic that is causing a bottle neck within a

  • 0

Generally

We have some business logic that is causing a bottle neck within a transaction. The business logic queries the database for a set of data (read only), processes it, and returns an object. This must be done many times with varying parameters in a given request. Can we theoretically break off each business logic call into a separate thread?

Specifically

EJB object (part of an http request on a JBoss App Server)
-creates objects that implement Callable (call method calls business logic method)
-using an ExecutorService invoke each callable object

Business Logic
-Makes a query of postgresql database which uses a PreparedStatement
-Using POJOs we build objects from ResultSet objects that come from postgresql
-Do expensive calculations

After all of this we get postgres errors that unnamed portals don’t exist even when we limit our threads to one:

ERROR:  cursor "<unnamed portal 777>" does not exist
STATEMENT:  FETCH ALL IN "<unnamed portal 777>"

I’m not quite sure what is happening to cause the error, but the business logic is being called correctly and it works fine without threading. This leads me to question whether threads can be started and added to a transaction (and if they can how do WE do it?).

  • 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-13T07:26:55+00:00Added an answer on May 13, 2026 at 7:26 am

    You should not create threads within an EJB (or anywhere else within an App server for that matter). If you need to break it down, use JMS or even simpler, use WorkManager to provide concurrency within the EJB based operation.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

In our case we have some business logic that looks into several tables in
I have some sgml files that are roughly standardized. However, there can be data
I have some code that generates image of a pie chart. It's a general
I understand that some countries have laws regarding website accessibility. In general, what are
I have found that there is generally a singe type or namespace that takes
Generally, MVC frameeworks have a structure that looks something like: /models /views /controllers /utils
I have the feeling that Flash -based ( or Silverlight -based) websites are generally
Generally the database server is the biggest, most expensive box we have to buy
I'm using a logging module that can have reporting enabled/disabled at runtime. Calls generally
My Oracle database contains some simple, rarely-changed data (it takes about months or even

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.