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

  • Home
  • SEARCH
  • 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 7601487
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 30, 20262026-05-30T23:10:31+00:00 2026-05-30T23:10:31+00:00

From what I’ve read, save() informs the persistence context that an instance should be

  • 0

From what I’ve read, save() informs the persistence context that an instance should be saved or updated. However, I have methods in a service that change the property of a domain instance without calling save() and the change appears instantly in my database, no problem.

Is the save() method just a more secure way of knowing that a domain instance will be updated after making a change (and catching errors with the failOnError mapping)? Should it be used EVERY time I change a domain instance’s properties or is that overdoing 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-30T23:10:32+00:00Added an answer on May 30, 2026 at 11:10 pm

    If you create a new instance of a domain class, then a .save() call will tell the underlying Hibernate layer to persist the new object to the database. Without the .save() it won’t be persisted to the database.

    If you retrieve an object via a .get(myId), then any changes will be automatically persisted to the database at the end of the underlying transaction because Hibernate sees the object as “dirty”. The end of a transaction is at the end of a method call to a transactional service or end of a request for controllers. You can call .save() if you want in these instances, but it isn’t necessary. It does provide easy access to flushing Hibernate via .save(flush:true) or the failOnError usage for validation.

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

Sidebar

Related Questions

From your experience, are there any security measures that one should undertake on a
From what I've read, VS 2008 SP1 and Team Foundation Server SP1 packages are
From what I've read about Windsor/Microkernel it is in theory possible to do everything
From PEP 8 : - Imports should usually be on separate lines, e.g.: Yes:
From the paper of bigtable. bigtable I read this: Each METADATA row stores approximately
from the app-context.xml: <bean id=userDao class=com.vaannila.dao.UserDAOImpl> <property name=sessionFactory ref=mySessionFactory/> </bean> <bean name=MyServiceT class=com.s.server.ServiceT> <property
From epoll's man page: epoll is a variant of poll(2) that can be used
From viewing the source code that this code makes it looks like itemValue generate
From previous queries, I have two variables. The first: <list> <item>a</item> <item>b</item> <item>a</item> <item>c</item>
I have a text area in my form which accepts all possible characters from

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.