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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 21, 20262026-05-21T05:13:10+00:00 2026-05-21T05:13:10+00:00

I have a class, Location. Location contains a List of BorderPoint objects, but it

  • 0

I have a class, Location. Location contains a List of BorderPoint objects, but it can be a HUGE list (20,000 is not impossible). The tables for this are LOCATION and BORDERPOINT.

I initially populate Location via an import from an ESRI Shapefile. Here’s a code snip:

        try {
            while (featureIterator.hasNext()) {
                Location location = new Location();

                SimpleFeatureImpl feature = (SimpleFeatureImpl) featureIterator.next();

                // set the information in location based on stuff in the feature, lets me clean up this
                // method a bit
                setLocationInfo(location, feature);

                List<BorderPoint> borderPointList = getBorderPoints(feature, location);
                //saveBorderPoints(location, feature);
                location.setBorderPointList(borderPointList);

                try {
                    locationRepository.persist(location);
                } catch (RepositoryException e) {
                    throw new ServiceException("processShapefile() threw RepositoryException", e);
                }
            }
        } finally {
            featureIterator.close();
        }

Since there are so many BorderPoint objects in the List, but I am only saving them by calling persist on the Location object, can I automatically set some sort of batch size for persisting the BorderPoints?

  • 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-21T05:13:10+00:00Added an answer on May 21, 2026 at 5:13 am

    I don’t know OpenJPA, but I have used Hibernate a lot. You probably have to control the transaction size yourself. If you change the code a little this should be easy:

    1. Create and persist the Location. You should probably also commit the database transaction.
    2. Persist BorderPoints into the database, making sure that you have set their parent Location. This implies that the parent Location is mapped on BorderPoint. You probably want to commit every 100 BorderPoints or so.
    3. Query the Location from the database and access its BorderPoints. All persisted BorderPoints should be there.
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have the following PHP Classes class.property.php class.location.php class.amenity.php class.category.php all four classes handles
I am making an jaxbcontext newInstance, passing DO as a class.My DO contains java.sql.clob
So Basically I have a <div> which contains two buttons. I want to position
I have two columns in a location model that should both associate with the
I know I can use something like MessageBox.Show(some error) but I'm talking about an
I'm making a vertical shooter game and I am having trouble with collision detection.
I recieve from an AJAX call data which has an architecture like data [0]
I am new to the Java EE platform and I am building a simple
Why draw operation in android canvas are using float instead of int for (x,y)?
I'm stuck trying to get the mapping I want to persist correctly. For my

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.