简体   繁体   English

EJB提交Web服务超时

[英]EJB commit on web service timeout

I'm using Glassfish 3.1.2.2. 我正在使用Glassfish 3.1.2.2。 I have an application that has an EJB (called MyBean) with TransactionManagementType.BEAN set on class level. 我有一个具有在类级别设置了TransactionManagementType.BEAN的EJB(称为MyBean)的应用程序。 In a business method I get connection from data source, set auto commit to false on the connection, do INSERT/DELETE/UPDATE on database tables and than commit at the end. 在一种业务方法中,我从数据源获取连接,在连接上将auto commit设置为false,对数据库表执行INSERT / DELETE / UPDATE,然后在最后提交。 Then I have a web service (called MyWebService) implemented in seperate class, that uses MyBean to call business methods. 然后,我在单独的类中实现了一个Web服务(称为MyWebService),该服务使用MyBean调用业务方法。 The client application is a seperate Java application that has webservice client generated with WSDL of MyWebService. 客户端应用程序是一个单独的Java应用程序,具有使用MyWebService的WSDL生成的Web服务客户端。 The client has set a timeout to 10 seconds. 客户端已将超时设置为10秒。 If the call to MyWebService takes more than 10 seconds the client gets a timout exception. 如果对MyWebService的调用花费了10秒钟以上,则客户端将收到一个timout异常。 This all OK. 一切都OK。 The problem I have is that in the Glassfish log I see that MyBean did all the work and also commited changed, but I don't see data in the database. 我的问题是,在Glassfish日志中,我看到MyBean完成了所有工作并且也提交了更改,但是我没有在数据库中看到数据。 This is driving me crazy! 这真让我抓狂! Does anyone know what is going on? 有人知道发生了什么吗?

Well, I found out that web service, Java EE or even GlassFish is not the guilty party. 好吧,我发现Web服务,Java EE甚至GlassFish都不是有罪的。 The guilty party is the client, that also does some updates on the database. 有罪的一方是客户端,它也在数据库上进行一些更新。 The client was responsible to overwrite the expected results. 客户负责覆盖预期结果。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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