Different Hibernate object states and their lifecycle in Hibernate | Techartifact

There are 3 hibernate object state

1.) Persistent– Persistent object and collections are short lived single threaded objects, which store the persistence state. These objects synchronize their state with database depending on your flush strategy(i.e auto flush where as soon as setXXX() method is called or an item is removed from a set,list etc or define your own synchronization points with session.flush().transaction.commit() calls.) If you remove an item from persistence collections like a Set, it will be removed from database either immediately or when flush() or commit() is called depending on your flush strategy. They are plain old java objects(POJO) and are currently associated with session. As soon as the associated session is closed , persistence objects become detached objects and are free to use directly as data transfer objects in any application layer like business Layers, presentation layer etc.

2.) Detached – These objects and collection are instances of persistence objects that were associated with a session but currently not with associated with session. These objects can be freely used as Data Transfer Objects without having any impact on your database .Detached objects can be later on attached to another session by calling methods like session.update(), session.saveOrUpdate() etc and become persistence objects.

3.) Transient – These objects and collection are instance of persistence object that were never associated with session.These objects can be freely used as Data transfer objects without having any impact on your database. Transient objects become persistent objects when associated to session by calling session.save(), session.persist() etc.

4.) Removed State -A previously persistent object that is deleted from the database session.delete(account).Java instance may still exist, but it is ignored by Hibernate -Any changes made to the object are not saved to the database Picked up for garbage collection once it falls out
of scope
• Hibernate does not null-out the in-memory object

Q: What are different Task Flow Component?

Method call-Provide a way to execute code within the flow.
Router – Provided way to branch the flow based on condition or by el.
Save Point Restore: Allows developer to take a snapshot of and ,then resotre,application state at specific point in flow.
Task Flow Call-Allow task flow to be called from this task flow.
URL View-Way to reach out the flow and potentiallu out og web application to some arbitrary URL such as http://www.techartifact.com
View:Allow display of page and page fragment.
Control Flow Case: Define flow between two activies.Similar to navigation case in ADF 10g or default jsf navigation engine.
WildCard Control Flow Rule: Provides way to define an origin for one or more global control flow cases that are shared and available from multiple activities on the diagram.