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.
我有一个托管 Web 服务的 WebSphere ESB 7.5(在中介模块内)。来自 Web 服务的数据应存储到数据库中。数据库访问应通过 JPA 执行。
我想将 JPA与WebSphere 的容器管理事务一起使用(因此 JPA 只是替换了普通的 SQL 调用,仅此而已)。我不想从本教程中生成 EJB。这对我的情况来说似乎是不必要的。
可能吗?任何代码示例?
JPA 规范中没有任何内容要求在应用程序容器中或通过 EJB 使用它。但是,关于您的第二个条件,容器管理的事务是在容器级别定义的,更具体地说,它们仅适用于实体 bean。因此,您的选择是使用: