Discussions

General J2EE: Disconnected POJO - what is that?

  1. Disconnected POJO - what is that? (2 messages)

    Hi Guys, I came across this term on the web, so I don't understand what the heck it means? I know how to write a simple hibernate/spring mvc web-app with some mapped POJOs, but I am curious if you guys heard of the term? If they (ie. disconnected POJOs) are different then the POJO's (self-contained java objects that know nothing about the web) that I know of, what exactly are their advantages? Ok, maybe i am confused. Umm, is there also a "connected" POJO? Thanks, Sean D.
  2. Hi Guys,

    I came across this term on the web, so I don't understand what the heck it means? I know how to write a simple hibernate/spring mvc web-app with some mapped POJOs, but I am curious if you guys heard of the term?

    If they (ie. disconnected POJOs) are different then the POJO's (self-contained java objects that know nothing about the web) that I know of, what exactly are their advantages? Ok, maybe i am confused.

    Umm, is there also a "connected" POJO?

    Thanks,
    Sean D.
    Disconnected POJO usually mean POJO that are no longer persisted, ie managed by Hibernate.
  3. Hi Sean, if you have developed hibernate/spring mvc web-apps then you are probably be using "connected" POJOs. So when you change some property value of an hibernate-loaded object into your business or view layer this is automatically persisted by hibernate, even if you don't call an explicit save() or update() method. On the other hand it may happen sometime that you are working with "disconnect" objects (disconnected from Hibernate session). This happens for example when the session is bound to the current thread and a transaction is committed or calling the Hibernate evict() method. In this conditions every change to the object is not automatically persisted as you are working with a transient = in-memory = disconnected object. Vincenzo Caselli info@censnet.it