Re: [jboss-user] [JCA] - How to define a read-only connection ?
by Adrian Brock
Adrian Brock [http://community.jboss.org/people/adrian%40jboss.org] replied to the discussion
"How to define a read-only connection ?"
To view the discussion, visit: http://community.jboss.org/message/533048#533048
--------------------------------------------------------------
> Roberto Mazzola wrote:
>
> I try it but it doesn't works.
>
> I change my DS to
>
> <connection-property name="readOnly" type="java.lang.Boolean">true</connection-property>
>
>
> It reply always "false".
>
> I try different way.. also using java standalone class but the only way is to invoke directly the setReadOnly method on the connection
>
> I opened also a post of IBM DB2 Forum....
>
> I hope to find a solution...
>
> ty
Actually that won't work.
I checked the dtd and there is no type="" attribute for ConnectionPropertys in -ds.xml,
only for ConfigPropertys in ra.xml
You might want to raise a feature request for it in JIRA?
If you can make your datasource XA, then you will be able to use
<xa-datasource-property name="readOnly">true</xa-datasource-property>
and it will work out the type from the setReadOnly(boolean) method.
For local datasources we don't know the types since we use
java.sql.Driver.connect(String, Properties);
and like I said above, there is no way to specify it.
--------------------------------------------------------------
Reply to this message by going to Community
[http://community.jboss.org/message/533048#533048]
Start a new discussion in JCA at Community
[http://community.jboss.org/choose-container!input.jspa?contentType=1&cont...]
16 years, 3 months
Re: [jboss-user] [JCA] - HornetQ RA integration
by Adrian Brock
Adrian Brock [http://community.jboss.org/people/adrian%40jboss.org] replied to the discussion
"HornetQ RA integration"
To view the discussion, visit: http://community.jboss.org/message/533034#533034
--------------------------------------------------------------
> Tim Fox wrote:
> If that's not correct, I find it odd. However our impl should work in either case now, since Jeff has created a proxy around the real XAResource which switches between a non transacted and an XA session behind the scenes depending on whether the resource has been enlisted or not.
I guess we could implement that for you with a slight tweak to the TxConnectionManager.
i.e. if you configure
<no-tx-seperate-pools/> - an old workaround for Oracle
on the tx-connection-factory we use the LocalXAResource rather than invoking getXAResource()
when the request is outside a JTA transaction at initial construction of the ManagedConnection,
regardless of whether it says <xa-transaction/>
That way you'll have two seperate pools for the different types of requests.
In one pool getXAResource() will have been invoked, in the other it won't.
Of course, other JCA implementations probably don't have that feature,
so you'll still have problems with them. ;-)
--------------------------------------------------------------
Reply to this message by going to Community
[http://community.jboss.org/message/533034#533034]
Start a new discussion in JCA at Community
[http://community.jboss.org/choose-container!input.jspa?contentType=1&cont...]
16 years, 3 months
Re: [jboss-user] [JCA] - HornetQ RA integration
by Adrian Brock
Adrian Brock [http://community.jboss.org/people/adrian%40jboss.org] replied to the discussion
"HornetQ RA integration"
To view the discussion, visit: http://community.jboss.org/message/533031#533031
--------------------------------------------------------------
> Tim Fox wrote:
>
> Adrian,
>
> So you're saying it's correct for a JCA impl to call
>
> getManagedConnection()
>
> then
>
> managedConnection.getXAResource()
>
> and then never enlist the resource in a tx, and expect the managed connection to behave as non transacted?
>
> I can't see this requirement in the JCA spec anyway, but I will defer to your better knowledge of JCA.
Why do you think that is a correct assumption?
The managed connections are pooled, so you've got no idea whether the connection is enlisted from one check out of the
connection from the pool to the next unless you track it yourself in the ManagedConnection/XAResource calls.
All your assumption does (including your wrapper workaround) is defer the failure to the case when
for the same ManagedConnection it does:
Request1: Is in a tx so use an XAConnection
Request2: Not in a tx - oops still tries to use an XAConnection for non xa stuff.
That is unless you back the ManagedConnection with two real connections/sessions?
Anyway, although not exactly on topic, I remember arguing about this line in the JCA 1.6 spec review
See 7.10.1 Transaction Scenarios Requirements
"
Note that both
LocalTransaction and XATransaction resource adapters support local
transactions. and they are both referred to as “local transaction capable” resource
adapters in the section below.
"
We came to conclusion that this statement (from an older version of the spec) says
that you can deploy a rar declared as XATransaction in local-tx mode at the connection factory level.
But it could also be taken to require the behaviour we are discussing?
--------------------------------------------------------------
Reply to this message by going to Community
[http://community.jboss.org/message/533031#533031]
Start a new discussion in JCA at Community
[http://community.jboss.org/choose-container!input.jspa?contentType=1&cont...]
16 years, 3 months
Re: [jboss-user] [JCA] - HornetQ RA integration
by Tim Fox
Tim Fox [http://community.jboss.org/people/timfox] replied to the discussion
"HornetQ RA integration"
To view the discussion, visit: http://community.jboss.org/message/533024#533024
--------------------------------------------------------------
Adrian,
So you're saying it's correct for a JCA impl to call
getManagedConnection()
then
managedConnection.getXAResource()
and then never enlist the resource in a tx, and expect the managed connection to behave as non transacted?
I can't see this requirement in the JCA spec anyway, but I will defer to your better knowledge of JCA.
Our assumption has been, if the AS calls getXAResource() it's reasonable to expect it has done so because it's going to enlist that resource in a tx.
If that's not correct, I find it odd. However our impl should work in either case now, since Jeff has created a proxy around the real XAResource which switches between a non transacted and an XA session behind the scenes depending on whether the resource has been enlisted or not.
--------------------------------------------------------------
Reply to this message by going to Community
[http://community.jboss.org/message/533024#533024]
Start a new discussion in JCA at Community
[http://community.jboss.org/choose-container!input.jspa?contentType=1&cont...]
16 years, 3 months