James Ellis
2007-12-17 22:58:11 UTC
We have created a stateless session bean that behaves as follows:
(pseudocode)
public void performExecute() throws ECException
{
BeanThatExtendsBaseJDBCHelperAccess bean = new
BeanThatExtendsBaseJDBCHelperAccess();
bean.updateAddress("bobby brown", "PO Box 222", "Hollywood, CA
90210");
//now make an HTTPS call using HttpsURLConnection and WAIT for a
response
HttpsURLConnection.callURL("https://someservice/that/will/call/me/
back.jsp") //bogus method obviously
}
When we call this other URL using HttpsURLConnection and wait for a
response...this other server then actually makes an https request to a
command on our server to fetch some stuff from the address table (I
know...I know...strange design). So the problem is that the
transaction in BeanThatExtendsBaseJDBCHelperAccess doesn't commit
until the end of the performExecute method...so when that service does
make a request to our machine and tries to update a field in that
address table (a timestamp) it gets stuck...because that row is still
locked because performExecute hasn't finished.
I thought that if we called "flush" after executing each method in
BeanThatExtendsBaseJDBCHelperAccess it would commit the transaction
and unlock the row...but its not behaving that way. Flush doesn't
appear to be doing anything.
Did I misinterpret the flush method?
Thanks,
Jim
(pseudocode)
public void performExecute() throws ECException
{
BeanThatExtendsBaseJDBCHelperAccess bean = new
BeanThatExtendsBaseJDBCHelperAccess();
bean.updateAddress("bobby brown", "PO Box 222", "Hollywood, CA
90210");
//now make an HTTPS call using HttpsURLConnection and WAIT for a
response
HttpsURLConnection.callURL("https://someservice/that/will/call/me/
back.jsp") //bogus method obviously
}
When we call this other URL using HttpsURLConnection and wait for a
response...this other server then actually makes an https request to a
command on our server to fetch some stuff from the address table (I
know...I know...strange design). So the problem is that the
transaction in BeanThatExtendsBaseJDBCHelperAccess doesn't commit
until the end of the performExecute method...so when that service does
make a request to our machine and tries to update a field in that
address table (a timestamp) it gets stuck...because that row is still
locked because performExecute hasn't finished.
I thought that if we called "flush" after executing each method in
BeanThatExtendsBaseJDBCHelperAccess it would commit the transaction
and unlock the row...but its not behaving that way. Flush doesn't
appear to be doing anything.
Did I misinterpret the flush method?
Thanks,
Jim