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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 2, 20262026-06-02T21:07:29+00:00 2026-06-02T21:07:29+00:00

This is not really a issue but it is a sometimes annoying thing during

  • 0

This is not really a issue but it is a sometimes annoying thing during my development. Let’s say I have some entities (db is created according those entities, not otherwise) and I decided to add a column, drop a column or something and now I need to commit those changes to my DB.

What is the best way to do that? I sometimes have to restart Glassfish; sometimes deploying it is enough; sometimes I need to erase tables manually because restarting won’t help. My strategy in persistence.xml is set to Create but other options didn’t really help me.

Is there any standard approach for commiting changes from entities to database?

  • 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-06-02T21:07:31+00:00Added an answer on June 2, 2026 at 9:07 pm

    From what I know there is no standard way in JPA to alter tables automagically during development and still keep the data in the table. For some cases switching to CREATE-DROP will do the trick – but then you will loose the data in the table and pretty quickly need to write scripts to populate said table. As you said it is not a big issue for you and it might be good practice to go from CREATE-DROP to a method that works in multi-person projects. My/our way is to have a sql script file in the repo, and when I alter my entites I (manually) alter that script or add a new script (the latter if the table is already in production or the data in the table is either more than a few line of inserts or created by use and not easily reproducable). This way we work with constantly merged and runnable code. Other project-members wanting to run the current development branch against a (local?) db where the table is out-of-date just needs to execute the sql script.

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

Sidebar

Related Questions

i've often had this issue where i do not really understand how to pass
This is not really a programming question but please bear with me as I
This does not really apply to any language specifically, but if it matters I
This is not really a question because I just solved the problem, but I
This is not a really Programming Question, but please bear with me as it's
Not really, but I am running into an issue where once in a blue
This is not really a programming question, more of an algorithmic one. The problem:
I know this question is not really important.. however I've been wondering: Which of
Not really too sure how to word this question, therefore if you don't particularly
I'm not really getting how this code does what it does: char shellcode[] =

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.