The resource manager evades the thread issue (and all related context
problems discussed so far) since it utilizes a different set of
interfaces.

The resource manager does not use UserTransaction which applies only to
the client calling thread, but XAResource which allows the transaction
to come from any thread.

In fact with XAResource you can have one single thread in your resource
manager that at the same time manages transactions coming from multiple
EJB threads, and you have to commit/rollback asynchronously.

So it's a totally different domain problem, the APIs for implementing
that are totally different (and way more powerful), but it also means
more development effort than just writing a bean.

As for synchronization, the resource manager has to deal with that by
means which a typical EJB bean will never address. Just consider that a
JDBC connection X may be used from two different threads at the same
time, may be used in transaction T2 while transaction T1 is still in the
process of committing (on the same connection), etc.

It makes the job of implementing a resource manager more complicated,
but it also gives you the proper API (and methodology) to deal with all
these issues in the proper manner.

arkin


Hed Bar-Nissan wrote:
>
> What about the need to implement a Resource Manager ?
> i want to use JMS + use it with connection pooling. since my vendor
> doesn't implement this i need to implement it myself.
> That ofcourse requires managing threads.
> ( being it a Resource manager dictates that my thread opening strategies
> are not that influenced that much by clients No. hence i won't damage
> that much the container own resource managment policies )
> Being quite frightened by all this thread ...
> - Assaf Arkin ( think deadlocks )
> is the next attitude contain some danger in it ?
> I want to use a singleton that would have a syncronized queue in it.
> from that queue i would dispatch messages to my private threads which
> though running under the same JVM might be cosidered out of EJB server
> boundaries. ( i"d like to cosider them that way. )
>
> So i have syncronized method and my own spawned threads but i try to be
> "polite","Unobtrusive" etc...
>
> would that work ?
> do i have any other way ? (i have to use JMS.)
>
> hed
>
> So ihave
>
> Assaf Arkin wrote:
>
> > francis pouatcha wrote:
> > >
> > > Don't forget the more iportant generic JTA package. Any subsytem
> > that presents
> > > itself to the EJB server with the interface
> > javax.transaction.XAResource
> > > interface could be thought of as a transactional resource manager.
> > (JDBC and JMS
> > > actually do that).
> >
> > I'm not. In fact, we're using XAResource all over the place for JDBC,
> > JMS, LDAP even editing XML files.
> >
> > The only problem is that the interface for JDBC and JMS is well
> > specified, the one for LDAP and XML is proprietary.
> >
> > But the connector architecture is supposed to allow everything to
> > support XAResource and be pulled in as a resource manager. That will
> > certainly remove some of the confusion people have, and no doubt add
> > more :-)
> >
> > arkin
> >
> > >
> > > Assaf Arkin wrote:
> >
> > ====================
> > ======================================================
> > To unsubscribe, send email to [EMAIL PROTECTED] and include in the
> > body
> > of the message "signoff EJB-INTEREST".  For general help, send email
> > to
> > [EMAIL PROTECTED] and include in the body of the message "help".
>
> ===========================================================================
> To unsubscribe, send email to [EMAIL PROTECTED] and include in the body
> of the message "signoff EJB-INTEREST".  For general help, send email to
> [EMAIL PROTECTED] and include in the body of the message "help".

--
----------------------------------------------------------------------
Assaf Arkin                                           www.exoffice.com
CTO, Exoffice Technologies, Inc.                        www.exolab.org

===========================================================================
To unsubscribe, send email to [EMAIL PROTECTED] and include in the body
of the message "signoff EJB-INTEREST".  For general help, send email to
[EMAIL PROTECTED] and include in the body of the message "help".

Reply via email to