Almost all applications require persistent data. Persistence is one of the fundamental concepts in appliction development.If an information system didn't preserve data entered by users when the host machine was powered off,the system would be of a little practical  use.When we talk about persistence in java,we are normally talking  about storing data in a relational database  using sql.

解决方案 »

  1.   

    hibernate是对jdbc的封装
    持久化的意义在于维护系统状态
      

  2.   

    那麼有狀態session bean一般用在什麼時候呢?比如我做一個網上購物系統,有狀態session bean用在購物車的實現上嗎?如果是用在購物車的實現上,那麼用session或database不就可以實現嗎,為什麼還要用有狀態session bean?
      

  3.   

    在cmp裡是容器幫我們實現了持久化。例如在購物系統中,client端在view系統時,server powered off了,一些data被持久化了,當server ok後,ejb容器把持久化後的數據反持久化了,不過client已經不用了,那麼這些被反持久化的data不就沒用了麼?