Re: EJB and J2C Connector Problem

Madhav Inamti <[email protected]> Wed, 27 Aug 2003 16:52:07 -0700
Newsgroups gmane.comp.java.sun.connector
Message-ID <75C025AE395F374B81F6416B1D4BDEFB0108D424@mtv-corpmail.microfocus.com>
This message is in MIME format. Since your mail reader does not understand
this format, some or all of this message may not be legible.

------_=_NextPart_001_01C36CF6.38FC2870
Content-Type: text/plain

I meant to say that if the connection handle was being closed, cleanup would
be called. (my reference to "after the method call" was the case in a demo I
recently worked on)



Since this is happening in your ejbCreate method, I'd suggest that you try
the setting the timeout on the bean (IBM Extensions Tabbed Pane in AAT) to 0
(no timeout, the default being 600) to see if the bean is getting timed out
and as a result connection handles are closed.



-Madhav Inamti

MicroFocus Inc.





-----Original Message-----
From: Jim Gish [mailto:[email protected]]
Sent: Wednesday, August 27, 2003 3:00 PM
To: [email protected]
Subject: Re: EJB and J2C Connector Problem



At 04:09 PM 8/27/2003, you wrote:



The connector 1.0 spec says that ManagedConnection.cleanup to be called (by
the container) after a method call thus returning the ManagedConnection to
the container pool. {spec. 5.5.4}



Where exactly does it say that? The only thing that I have seem that comes
close to that is in the 1.5 spec where the adapter implements the
DissociatableManagedConnection and the app server implements
LazyAssociatableConnectionManager.  This allows connection optimization of
shared connections whereby the app server can disociate a connection handle
from its ManagedConnection at times such as method completion and the
adapter can them re-associate a application-cached connection handle the
next time it is used.

However, 1.0 doesn't provide for this optimization and connection handles
should not be invalidated as John is seeing.




However you can use
matchManagedConnections in your ManagedConnectionFactory to identify the
managed connection based on the data you have in your implementation of
ConnectionRequestInfo interface.

Hope this helps.

Madhav Inamti
Micro Focus Inc.


-----Original Message-----
From: John Pickler [mailto:[email protected] <mailto:[email protected]> ]
Sent: Wednesday, August 27, 2003 11:30 AM
To: [email protected]
Subject: EJB and J2C Connector Problem

I have a written a J2EE Connector Architecture 1.0 Resource Adapter for
my company along with some sample customer applications.  I have several
applications in which I need a stateful session bean to create a
connection through my resource adapter, and then have the client be able to
call the methods on that EJB instance with that same connection.  The reason
they need to be the same connection is so that the work done on my ERP
server (which is what my resource adapter talks to) will be recognized as
one single, related user session on the ERP side.  However, I've done
significant debugging in WebSphere 5.0.2 (my company's platform of choice),
and I am finding that although the connection is being created
(by me) in the ejbCreate() method, the container is calling my
ManagedConnection.cleanup() method after the ejbCreate() method is finished,
which of course terminates the connection.  I need this connection to stay
live across multiple Interaction.execute() calls on my resource adapter.
Any ideas on how I accomplish this?  Am I doing something wrong?

Thanks,
DW

===========================================================================
To unsubscribe, send email to [email protected] and include in the body
of the message "signoff CONNECTOR-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 CONNECTOR-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 CONNECTOR-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 CONNECTOR-INTEREST".  For general help, send email to
[email protected] and include in the body of the message "help".

------_=_NextPart_001_01C36CF6.38FC2870
Content-Type: text/html

<html>

<head>
<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=us-ascii">


<meta name=Generator content="Microsoft Word 10 (filtered)">

<style>
<!--
 /* Font Definitions */
 @font-face
        {font-family:Courier;
        panose-1:2 7 4 9 2 2 5 2 4 4;}
@font-face
        {font-family:"MS Mincho";
        panose-1:2 2 6 9 4 2 5 8 3 4;}
@font-face
        {font-family:Tahoma;
        panose-1:2 11 6 4 3 5 4 4 2 4;}
@font-face
        {font-family:"\@MS Mincho";
        panose-1:2 2 6 9 4 2 5 8 3 4;}
 /* Style Definitions */
 p.MsoNormal, li.MsoNormal, div.MsoNormal
        {margin:0in;
        margin-bottom:.0001pt;
        font-size:12.0pt;
        font-family:"Times New Roman";}
a:link, span.MsoHyperlink
        {color:blue;
        text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
        {color:blue;
        text-decoration:underline;}
span.EmailStyle17
        {font-family:Arial;
        color:navy;}
@page Section1
        {size:8.5in 11.0in;
        margin:1.0in 1.25in 1.0in 1.25in;}
div.Section1
        {page:Section1;}
-->
</style>

</head>

<body lang=EN-US link=blue vlink=blue>

<div class=Section1>

<p class=MsoNormal><font size=2 color=navy face=Arial><span style='font-size:
10.0pt;font-family:Arial;color:navy'>I meant to say that if the connection
handle was being closed, cleanup would be called. (my reference to "after
the method call" was the case in a demo I recently worked on) </span></font></p>

<p class=MsoNormal><font size=2 color=navy face=Arial><span style='font-size:
10.0pt;font-family:Arial;color:navy'>&nbsp;</span></font></p>

<p class=MsoNormal><font size=2 color=navy face=Arial><span style='font-size:
10.0pt;font-family:Arial;color:navy'>Since this is happening in your ejbCreate
method, I'd suggest that you try the setting the timeout on the bean (IBM
Extensions Tabbed Pane in AAT) to 0 (no timeout, the default being 600) to see
if the bean is getting timed out and as a result connection handles are closed.
</span></font></p>

<p class=MsoNormal><font size=2 color=navy face=Arial><span style='font-size:
10.0pt;font-family:Arial;color:navy'>&nbsp;</span></font></p>

<p class=MsoNormal><font size=2 color=navy face=Arial><span style='font-size:
10.0pt;font-family:Arial;color:navy'>-</span></font><font size=2 color=navy
 face=Arial><span style='font-size:10.0pt;font-family:Arial;color:navy'>Madhav
 Inamti</span></font></p>

<p class=MsoNormal><font size=2 color=navy face=Arial><span style='font-size:
10.0pt;font-family:Arial;color:navy'>MicroFocus Inc.</span></font></p>

<p class=MsoNormal><font size=2 color=navy face=Arial><span style='font-size:
10.0pt;font-family:Arial;color:navy'>&nbsp;</span></font></p>

<p class=MsoNormal><font size=2 color=navy face=Arial><span style='font-size:
10.0pt;font-family:Arial;color:navy'>&nbsp;</span></font></p>

<p class=MsoNormal style='margin-left:.5in'><font size=2 face=Tahoma><span
style='font-size:10.0pt;font-family:Tahoma'>-----Original Message-----<br>
<b><span style='font-weight:bold'>From:</span></b> Jim Gish
[mailto:[email protected]] <br>
<b><span style='font-weight:bold'>Sent:</span></b> Wednesday, August 27, 2003
3:00 PM<br>
<b><span style='font-weight:bold'>To:</span></b>
[email protected]<br>
<b><span style='font-weight:bold'>Subject:</span></b> Re: EJB and J2C Connector
Problem</span></font></p>

<p class=MsoNormal style='margin-left:.5in'><font size=3 face="Times New Roman"><span
style='font-size:12.0pt'>&nbsp;</span></font></p>

<p class=MsoNormal style='margin-left:.5in'><font size=3 face="Times New Roman"><span
style='font-size:12.0pt'>At 04:09 PM 8/27/2003, you wrote:<br>
<br>
</span></font></p>

<p class=MsoNormal style='margin-left:.5in'><font size=3 face="Times New Roman"><span
style='font-size:12.0pt'>The connector 1.0 spec says that
ManagedConnection.cleanup to be called (by<br>
the container) after a method call thus returning the ManagedConnection to<br>
the container pool. {spec. 5.5.4} </span></font></p>

<p class=MsoNormal style='margin-left:.5in'><font size=3 face="Times New Roman"><span
style='font-size:12.0pt'><br>
<br>
Where exactly does it say that? The only thing that I have seem that comes
close to that is in the 1.5 spec where the adapter implements the </span></font><font
size=2 face=Courier><span style='font-size:10.0pt;font-family:Courier'>DissociatableManagedConnection</span></font><font
face=Courier><span style='font-family:Courier'> and the app server implements </span></font><font
size=2 face=Courier><span style='font-size:10.0pt;font-family:Courier'>LazyAssociatableConnectionManager.&nbsp;
This allows connection optimization of shared connections whereby the app
server can disociate a connection handle <br>
</span></font>from its ManagedConnection at times such as method completion and
the adapter can them re-associate a application-cached connection handle the
next time it is used.&nbsp; <br>
<br>
However, 1.0 doesn't provide for this optimization and connection handles should
not be invalidated as John is seeing. <br>
<br>
<br>
</p>

<p class=MsoNormal style='margin-left:.5in'><font size=3 face="Times New Roman"><span
style='font-size:12.0pt'>However you can use<br>
matchManagedConnections in your ManagedConnectionFactory to identify the<br>
managed connection based on the data you have in your implementation of<br>
ConnectionRequestInfo interface.<br>
<br>
Hope this helps.<br>
<br>
Madhav Inamti<br>
Micro Focus Inc.<br>
<br>
<br>
-----Original Message-----<br>
From: John Pickler [<a href="mailto:[email protected]" eudora=autourl>mailto:[email protected]</a>]<br>
Sent: Wednesday, August 27, 2003 11:30 AM<br>
To: [email protected]<br>
Subject: EJB and J2C Connector Problem<br>
<br>
I have a written a J2EE Connector Architecture 1.0 Resource Adapter for<br>
my company along with some sample customer applications.&nbsp; I have several<br>
applications in which I need a stateful session bean to create a<br>
connection through my resource adapter, and then have the client be able to<br>
call the methods on that EJB instance with that same connection.&nbsp; The
reason<br>
they need to be the same connection is so that the work done on my ERP<br>
server (which is what my resource adapter talks to) will be recognized as<br>
one single, related user session on the ERP side.&nbsp; However, I've done<br>
significant debugging in WebSphere 5.0.2 (my company's platform of choice),<br>
and I am finding that although the connection is being created<br>
(by me) in the ejbCreate() method, the container is calling my<br>
ManagedConnection.cleanup() method after the ejbCreate() method is finished,<br>
which of course terminates the connection.&nbsp; I need this connection to stay<br>
live across multiple Interaction.execute() calls on my resource adapter.<br>
Any ideas on how I accomplish this?&nbsp; Am I doing something wrong?<br>
<br>
Thanks,<br>
DW<br>
<br>
===========================================================================<br>
To unsubscribe, send email to [email protected] and include in the body<br>
of the message &quot;signoff CONNECTOR-INTEREST&quot;.&nbsp; For general help,
send email<br>
to<br>
[email protected] and include in the body of the message &quot;help&quot;.<br>
<br>
===========================================================================<br>
To unsubscribe, send email to [email protected] and include in the body<br>
of the message &quot;signoff CONNECTOR-INTEREST&quot;.&nbsp; For general help,
send email to<br>
[email protected] and include in the body of the message &quot;help&quot;.</span></font></p>

</div>

</body>

</html>
===========================================================================
To unsubscribe, send email to [email protected] and include in the body
of the message "signoff CONNECTOR-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 CONNECTOR-INTEREST".  For general help, send email to
[email protected] and include in the body of the message "help".
------_=_NextPart_001_01C36CF6.38FC2870--