org.hibernate.TransientObjectException

object references an unsaved transient instance - save the transient instance before flushing: Country1

Samebug tips0

There are no available Samebug tips for this exception. If you know how to solve this issue, help other users by writing a short tip.

Don't give up yet. Paste your full stack trace to get a solution.

Solutions on the web145

  • via Terracotta by girish_k, 11 months ago
    object references an unsaved transient instance - save the transient instance before flushing: Country1
  • via Coderanch by sardar waqas ahmed, 7 months ago
    object references an unsaved transient instancesave the transient instance before flushing: com.hrms.persistanceLayer.HrAddress
  • via openxava by henryedsl
    , 11 months ago
    object references an unsaved transient instance - save the transient instance before flushing: org.admon.db.compras.modelo.Ods.moneda -> org.admon.db.compras.modelo.Moneda
  • Stack trace

    • org.hibernate.TransientObjectException: object references an unsaved transient instance - save the transient instance before flushing: Country1 at org.hibernate.engine.ForeignKeys.getEntityIdentifierIfNotUnsaved(ForeignKeys.java:219) at org.hibernate.type.ManyToOneType.disassemble(ManyToOneType.java:163) at org.hibernate.cache.StandardQueryCache.put(StandardQueryCache.java:80) at org.hibernate.loader.Loader.putResultInQueryCache(Loader.java:2194) at org.hibernate.loader.Loader.listUsingQueryCache(Loader.java:2138) at org.hibernate.loader.Loader.list(Loader.java:2096) at org.hibernate.loader.criteria.CriteriaLoader.list(CriteriaLoader.java:94) at org.hibernate.impl.SessionImpl.list(SessionImpl.java:1569) at org.hibernate.impl.CriteriaImpl.list(CriteriaImpl.java:283) at com.wakaleo.articles.caching.dao.CountryDAO.getCountries(CountryDAO.java:32) at com.wakaleo.articles.caching.dao.CountryDAOTest.testGetCountries(CountryDAOTest.java:35) at com.wakaleo.articles.caching.dao.CountryDAOTest.main(CountryDAOTest.java:91)

    Write tip

    You have a different solution? A short tip here would help you and many other users who saw this issue last week.

    Users with the same issue

    Unknown user
    Once, 1 year ago
    Unknown user
    Once, 1 year ago
    Unknown user
    Once, 1 year ago
    Unknown user
    Once, 1 year ago