Hey ranchers
A session bean instance is an extension of the client that creates it:
• It typically reads and updates data in a database on behalf of the client.
Typically, a session object’s conversational state is not written to the database.
The file system APIs are not well-suited for business components to access data. Business components
should use a resource manager API, such as JDBC, to store data.
Again, typically, a session object’s conversational state is
not written to the database. Especially since the following text continues to detail how data should be written to the database with and without the
Java Persistence API, how is this not a contradiction and/or please tell me what I'm missing here?
(follows above quotes)
A session bean that does not make use of the Java Persistence API must explicitly manage cached database
data. A session bean instance must write any cached database updates prior to a transaction completion,
and it must refresh its copy of any potentially stale database data at the beginning of the next
transaction. A session bean must also refresh any java.sql Statement objects before they are used in
a new transaction context. Use of the Java Persistence API provides a session bean with automatic management
of database data, including the automatic flushing of cached database updates upon transaction
commit.