简体   繁体   中英

How is an EJB stateful session bean passivated to secondary storage

I have read for stateful session bean:

"While in the ready stage, the EJB container may decide to deactivate, or passivate, the bean by moving it from memory to secondary storage"

So what is this secondary storage? Is it the underline database? Also, how is an object saved (persisted) in a relational database like Oracle?

Java EE is only a specification and it is up to the JEE compliant application server (such as Glassfish , Wildfly , or WebLogic ) to determine exactly what the secondary storage is.

WebLogic, at least by default, passivates the EJB:s to disk which is described by this image:

WebLogic状态会话EJB生命周期

The WildFly/JBoss (which is my application server of choice) documentation is quite sparse regarding this, but a fair guess is that the default behaviour is to passivate the EJB:s to disk as well, though I cannot swear on it.

So, once again, the specification doesn't give any rules on how to passivate the EJB:s, it is up to the implementation.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM