-
1. Re: oracle ds and Timer MBean in Stateful Session Bean
genman Nov 3, 2003 12:54 PM (in response to gue13)
If your timer event is being activated through JMX, there is no container transaction established. The datasource you are using isn't going to work right. You can use a datasource that supports local transactions (if you can establish a user transaction) or no transactions.
<no-tx-datasource>
... connection info goes here ...
</no-tx-datasource>
I would recommend firing a message through JMS to have some sort of transaction context to work with the session bean. -
2. Re: oracle ds and Timer MBean in Stateful Session Bean
frito Nov 4, 2003 4:06 AM (in response to gue13)IMHO, this is very bad design.
No matter if you can get this to run, you must not do this. With registering your SFSB as listener to the Timer, you are violating the programming restrictions (EJB spec), since the timer is doing a callback by referencing the bean instance.
Greetings,
Frito -
3. Re: oracle ds and Timer MBean in Stateful Session Bean
gue13 Nov 4, 2003 4:13 AM (in response to gue13)i tried this in oracle_ds.xml:
<no-tx-datasource>
<jndi-name>OraclePOS</jndi-name>
<connection-url>jdbc:oracle:thin:@[myip]:[myport]:[mysid]</connection-url>
<driver-class>oracle.jdbc.driver.OracleDriver</driver-class>
<user-name>[myuser]</user-name>
[mypwd]
<!-- <transaction-isolation>TRANSACTION_SERIALIZABLE</transaction-isolation> -->
<!--pooling parameters-->
<min-pool-size>1</min-pool-size>
<max-pool-size>5</max-pool-size>
<blocking-timeout-millis>5000</blocking-timeout-millis>
<idle-timeout-minutes>5</idle-timeout-minutes>
<exception-sorter-class-name>org.jboss.resource.adapter.jdbc.vendor.OracleExceptionSorter</exception-sorter-class-name>
</no-tx-datasource>
in addition an entry in transaction-service.xml:
true
without this, connection will be closed after a business method...
=> no changes, same error-message!
java.sql.SQLException: Connection handle is not currently associated with a ManagedConnection
very strange i think, the "no-tx-datasource"-declaration prevents using my datasource in transaction context? -
4. Re: oracle ds and Timer MBean in Stateful Session Bean
gue13 Nov 4, 2003 4:16 AM (in response to gue13)hi frito,
tanks for your advise, i know it's not a "beautiful" solution - but the major problem is: how can i achive a custom timout starting after completing a business-method in a sfsb?
kind regards -
5. Re: oracle ds and Timer MBean in Stateful Session Bean
frito Nov 4, 2003 4:22 AM (in response to gue13)I think the trick is not building a workaround and NOT doing this in SFSB.
Your SFSB could call a MBean doing all the things you like to do.
Greetings,
Frito -
6. Re: oracle ds and Timer MBean in Stateful Session Bean
gue13 Nov 4, 2003 6:05 AM (in response to gue13)hi frito,
if i would be at the beginning of a project, maybe i would consider a better solution, but in fact, i have a sfsb with 3 business-methods, and a few jdbc-statements (select for update, etc.) over all 3 methods.
i need a kind of timeout-facility between the business-methods (eg. after the first, before the second) very urgent. is there no way, to solve this problem??? any idea?? it's hard to believe, that nobody needs more than the one timeout defined for the whole SFSB...
kind regards