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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 1, 20262026-06-01T15:04:04+00:00 2026-06-01T15:04:04+00:00

If I add a new object and go .save() then run a select, the

  • 0

If I add a new object and go .save() then run a select, the last object created, is retrieved from the classes, rather than the DB, which means a date property hasn’t been converted into SQL format and its mucking up some frontend code of mine.

E.G

Tue Feb 06, 2012 instead of 2012-02-06 00:00:00

Is there a way to make sure all my objects get pulled from database?

Thanks

  • 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-01T15:04:05+00:00Added an answer on June 1, 2026 at 3:04 pm

    Hibernate has a few levels of cache. What you are experiencing is the session/first level cache. There is no way to disable that. But you can look into using a StatelessSession http://docs.jboss.org/hibernate/core/3.6/reference/en-US/html/batch.html Section 15.3 if you are insistent on doing something like this.

    I advice you re-think your separation of User Interface, Business Logic and Persistence Layer if you are relying on the database to return correctly formatted date strings to your users. You shouldn’t care how the Database or Hibernate formarts strings as long as you can understand the data you are storing/retrieving. Look into MVC, MVVM, or any other patterns of separation.

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

Sidebar

Related Questions

Then: protected void Page_Load(object sender, EventArgs e) { if (!Page.IsPostBack) { CheckBoxList1.Items.Add(new ListItem(item1)); CheckBoxList1.Items.Add(new
If I call Save on a new object, then populate its properties, NHibernate generates
How do I add a new DataColumn to a DataTable object that already contains
protected void Button1_Click(object sender, EventArgs e) { System.Collections.ArrayList list = new System.Collections.ArrayList(); list.Add(abc); list.Add(xyz);
String a []= {null,null,null,null,null}; //add array to arraylist ArrayList<Object> choice = new ArrayList<Object>(Arrays.asList(a)); System.out.println(choice.size());
public static void main(String[] args) { List<? extends Object> mylist = new ArrayList<Object>(); mylist.add(Java);
I have a piece of code like this: HashSet<Object> Set = new HashSet<Object>(); //add
I am trying to save a new Object to my context, that will have
I have code which is updating a model's property then calling save! . A
Does it make sense to create new object before trying to save object that

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.