Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
作为一名 Java 程序员,你通常会把两个真理放在口袋里:
现在我几乎在所有事情中都使用了 Hibernate,我意识到我对自己并不确定。
是否有一些好的经验法则来使用休眠并知道你的记忆在哪里?
我不太确定你的意思。我确实知道所有对象(Hibernate 或其他),即使您只有对它们的本地引用,也会在堆上进行。
我更担心你的代码的正确性而不是这种事情,我怀疑它会显着影响性能。一个数据库查询将使可能的速度差异相形见绌。