Hi,
I have given this a try based on what I tried in JIRA-1665 (Sample Using
JOTM with DAS)
Here also I am using JOTM with SCA+DAS. Currently played with 2 simple
intents:
a> transaction (Tx management from External TM), b> noTransaction (Tx
management from DAS)

The only changes needed are as below:-
A> tuscany-data-engine-helper:-
1)DataAccessEngineManager
new method getDAS(String config, ConnectionInfo connectionInfo, List<Intent>
intents, List<PolicySet> policySets)
Here if intent "a>transaction" is detected, ConnectionInfo.setManagedTx(false)
will be called.
This modified connnectionInfo will be passed through configHelper to the new
DAS instance.
This way if external TM is going to manage Tx, DAS is signaled for it.

And logic to support this method

2) ConnectionInfo
new attribute managedtx with setter/getter

B> tuscany-implementation-das
1) DASImplementation implements PolicyAttachPoint

2) DASImplementationProcessor
read(reader) - will read policies and intents on DASImplementation from
.composite

3) DASImplementationProvider
createInvoker() will call getDAS(passing config, connectioninfo, intents,
policies)
same will be for createCallbackInvoker()

With these above changes and with setup similar to JIRA-1665 sample, I could
see
that the external connection is being used by DAS (naming service is
resolving
datasource properly).

The point I am stuck at is, in RDB-DAS, when we use external DS, we do not
pass
userName, password. But MYSQL (which with InnoDB supports Txn and works well
with JOTM) does need id, pwd in ds.getConnection(). This can be case with
other DBs as well.

So, it looks like DAS config.xsd needs to allow passing userName, password
in ConnectionInfo too ( and not just for ConnectionProperties).

Thus below will be the changed DAS config portion:-
   <xsd:complexType name="ConnectionInfo">
      <xsd:sequence>
        <xsd:element  maxOccurs="1" minOccurs="0"
name="ConnectionProperties" type="config:ConnectionProperties"/>
      </xsd:sequence>
      <xsd:attribute name="dataSource" type="xsd:string"/>
      <xsd:attribute name="managedtx" type="xsd:boolean" default="true"/>
      <xsd:attribute name="userName" type="xsd:string" default=""/>
      <xsd:attribute name="password" type="xsd:string" default=""/>
   </xsd:complexType>

   <xsd:complexType name="ConnectionProperties">
         <xsd:attribute name="driverClass" type="xsd:string"/>
         <xsd:attribute name="databaseURL" type="xsd:string"/>
         <xsd:attribute name="loginTimeout" type="xsd:int"
default="0"/>
   </xsd:complexType>

Suggestion? If this looks OK, I would like to make the above changes and
create a sample in tuscany-implementation-das demoing use of intent and ext
TM.
Will give a try with geronimo as well.

Regards,
Amita

On 9/2/07, Jean-Sebastien Delfino <[EMAIL PROTECTED]> wrote:
>
> [snip]
> Luciano Resende wrote:
> > I guess your suggestion for starting simple is fine, and I guess
> > implementation.das could get integrated with SCA Policy and DAS would
> > have the necessary support, unless we find some bugs on the DAS side.
> > I'll see if I can get to this in the coming weeks...
> >
> > BTW, what transaction manager are we going to use in Tuscany ?  Do we
> > have any today ?
> >
>
> Two suggestions:
> - in a standalone environment, use JOTM [1]
> - in Geronimo, get the TM from Geronimo, as done in the Tuscany/Geronimo
> plugin at [2]
>
> [1] http://jotm.objectweb.org/
> [2] http://svn.apache.org/repos/asf/geronimo/plugins/tuscany
>
> --
> Jean-Sebastien
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>
>

Reply via email to