开发者

Hibernate session.beginTransaction() call and Mysql Start Transaction

When I issue the command

session.beginTransaction();
// do something
session.getTransaction().commit();

I don't see a corresponding Start Transaction c开发者_StackOverflow社区ommand issue to my database. Can any body explain to why it is not there and how mysql knows the boundary of a transaction.

Thanks,


As briefly mentioned in the Hibernate Developer Guide, JDBC does not define an explicit method for beginning a transaction. The Java JDBC Tutorial mentions disabling auto-commit mode to be able to group two or more statements into a transaction. This is exactly what Hibernate does in the session.beginTransaction() call.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜