Unix Technical Forum

XA end then join fix for WebLogic

This is a discussion on XA end then join fix for WebLogic within the pgsql Interfaces jdbc forums, part of the PostgreSQL category; --> Jan de Visser ran into problems with our XA implementation earlier, and traced the problem to the sequence of ...


Go Back   Unix Technical Forum > Database Server Software > PostgreSQL > pgsql Interfaces jdbc

Register FAQ Members List Calendar Search Today's Posts Mark Forums Read
  #1 (permalink)  
Old 04-16-2008, 12:20 AM
Heikki Linnakangas
 
Posts: n/a
Default XA end then join fix for WebLogic

Jan de Visser ran into problems with our XA implementation earlier, and
traced the problem to the sequence of XADataSource method calls that
WebLogic performed. He fixed it with a simple patch that allows
start(.., TMJOIN) on a transaction that was ended earlier using the same
connection:

http://archives.postgresql.org/pgsql...2/msg00038.php

It puzzles me why WebLogic does that, but it seems valid and we should
support it, even though we can't support join in general.

Here's a more polished version of Jan's patch. I don't have WebLogic to
test this with, so I would appreciate if those that have access to
WebLogic could reproduce the original problem and confirm that this
patch fixes it.

--
Heikki Linnakangas
EnterpriseDB http://www.enterprisedb.com


---------------------------(end of broadcast)---------------------------
TIP 4: Have you searched our list archives?

http://archives.postgresql.org

Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #2 (permalink)  
Old 04-16-2008, 12:20 AM
Jan de Visser
 
Posts: n/a
Default Re: XA end then join fix for WebLogic

On Monday 02 October 2006 07:46, Heikki Linnakangas wrote:
> Jan de Visser ran into problems with our XA implementation earlier, and
> traced the problem to the sequence of XADataSource method calls that
> WebLogic performed. He fixed it with a simple patch that allows
> start(.., TMJOIN) on a transaction that was ended earlier using the same
> connection:
>
> http://archives.postgresql.org/pgsql...2/msg00038.php
>
> It puzzles me why WebLogic does that, but it seems valid and we should
> support it, even though we can't support join in general.
>
> Here's a more polished version of Jan's patch. I don't have WebLogic to
> test this with, so I would appreciate if those that have access to
> WebLogic could reproduce the original problem and confirm that this
> patch fixes it.


I'll have a look "soon". Any deadlines?

jan


--
--------------------------------------------------------------
Jan de Visser * * * * * * * * * * jdevisser@digitalfairway.com

* * * * * * * * Baruk Khazad! Khazad ai-menu!
--------------------------------------------------------------

---------------------------(end of broadcast)---------------------------
TIP 9: In versions below 8.0, the planner will ignore your desire to
choose an index scan if your joining column's datatypes do not
match

Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #3 (permalink)  
Old 04-16-2008, 12:20 AM
Heikki Linnakangas
 
Posts: n/a
Default Re: XA end then join fix for WebLogic

Jan de Visser wrote:
> I'll have a look "soon". Any deadlines?


I believe there's going to be a stable JDBC driver release 8.2 when
PostgreSQL 8.2 is released. It would be nice to get the fix into that
release. Other than that, no.

--
Heikki Linnakangas
EnterpriseDB http://www.enterprisedb.com

---------------------------(end of broadcast)---------------------------
TIP 3: Have you checked our extensive FAQ?

http://www.postgresql.org/docs/faq

Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #4 (permalink)  
Old 04-16-2008, 12:26 AM
Kris Jurka
 
Posts: n/a
Default Re: XA end then join fix for WebLogic



On Mon, 2 Oct 2006, Heikki Linnakangas wrote:

> Jan de Visser ran into problems with our XA implementation earlier, and
> traced the problem to the sequence of XADataSource method calls that WebLogic
> performed. He fixed it with a simple patch that allows start(.., TMJOIN) on a
> transaction that was ended earlier using the same connection:
>
> http://archives.postgresql.org/pgsql...2/msg00038.php
>
> It puzzles me why WebLogic does that, but it seems valid and we should
> support it, even though we can't support join in general.
>
> Here's a more polished version of Jan's patch. I don't have WebLogic to test
> this with, so I would appreciate if those that have access to WebLogic could
> reproduce the original problem and confirm that this patch fixes it.
>


Doesn't this allow:

xaRes.start(xid, XAResource.TMNOFLAGS);
xaRes.end(xid, XAResource.TMFAIL);
xaRes.start(xid, XAResource.TMJOIN);
xaRes.end(xid, XAResource.TMSUCCESS);
xaRes.commit(xid, true);

Is that actually a problem or do we assume the TM is smart enough not to
do this.

Kris Jurka

---------------------------(end of broadcast)---------------------------
TIP 2: Don't 'kill -9' the postmaster

Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #5 (permalink)  
Old 04-16-2008, 12:26 AM
Heikki Linnakangas
 
Posts: n/a
Default Re: XA end then join fix for WebLogic

Kris Jurka wrote:
> Doesn't this allow:
>
> xaRes.start(xid, XAResource.TMNOFLAGS);
> xaRes.end(xid, XAResource.TMFAIL);
> xaRes.start(xid, XAResource.TMJOIN);
> xaRes.end(xid, XAResource.TMSUCCESS);
> xaRes.commit(xid, true);
>
> Is that actually a problem or do we assume the TM is smart enough not to
> do this.


Hmm, true, it does allow that.

The TM really shouldn't be doing that. It's very confused if it does.
However, given the sorry state of many TMs out there, it'd be nice if we
did check for that.

I'd say let's not bother checking that for now. In the future, we should
roll back the transaction on end(TMFAIL) immediately, and add checking
for that case as well. The way it works now is perfectly correct and
legal, we're just not taking advantage of the hint the TM is giving us.

--
Heikki Linnakangas
EnterpriseDB http://www.enterprisedb.com

---------------------------(end of broadcast)---------------------------
TIP 1: if posting/reading through Usenet, please send an appropriate
subscribe-nomail command to majordomo@postgresql.org so that your
message can get through to the mailing list cleanly

Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #6 (permalink)  
Old 04-16-2008, 12:26 AM
Kris Jurka
 
Posts: n/a
Default Re: XA end then join fix for WebLogic



On Fri, 1 Dec 2006, Heikki Linnakangas wrote:

> Kris Jurka wrote:
>> Doesn't this allow:
>>
>> xaRes.start(xid, XAResource.TMNOFLAGS);
>> xaRes.end(xid, XAResource.TMFAIL);
>> xaRes.start(xid, XAResource.TMJOIN);
>> xaRes.end(xid, XAResource.TMSUCCESS);
>> xaRes.commit(xid, true);
>>
>> Is that actually a problem or do we assume the TM is smart enough not to do
>> this.

>
> Hmm, true, it does allow that.
>
> The TM really shouldn't be doing that. It's very confused if it does.
> However, given the sorry state of many TMs out there, it'd be nice if we did
> check for that.
>
> I'd say let's not bother checking that for now. In the future, we should roll
> back the transaction on end(TMFAIL) immediately, and add checking for that
> case as well. The way it works now is perfectly correct and legal, we're just
> not taking advantage of the hint the TM is giving us.
>


OK. Applied.

Kris Jurka


---------------------------(end of broadcast)---------------------------
TIP 1: if posting/reading through Usenet, please send an appropriate
subscribe-nomail command to majordomo@postgresql.org so that your
message can get through to the mailing list cleanly

Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #7 (permalink)  
Old 04-16-2008, 12:26 AM
Jan de Visser
 
Posts: n/a
Default Re: XA end then join fix for WebLogic

On Friday 01 December 2006 7:28 am, Kris Jurka wrote:
> OK. *Applied.
>
> Kris Jurka


You guys still interested in WebLogic testresults? I guess yes. ISTR that
there is also an open TODO to update the FAQ with config info for various
appservers. I can have a go at that for WL and JBoss.

jan

--
--------------------------------------------------------------
Jan de Visser * * * * * * * * * * jdevisser@digitalfairway.com

* * * * * * * * Baruk Khazad! Khazad ai-menu!
--------------------------------------------------------------

---------------------------(end of broadcast)---------------------------
TIP 9: In versions below 8.0, the planner will ignore your desire to
choose an index scan if your joining column's datatypes do not
match

Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #8 (permalink)  
Old 04-16-2008, 12:26 AM
Kris Jurka
 
Posts: n/a
Default Re: XA end then join fix for WebLogic



On Fri, 1 Dec 2006, Jan de Visser wrote:

> On Friday 01 December 2006 7:28 am, Kris Jurka wrote:
>> OK. *Applied.
>>
>> Kris Jurka

>
> You guys still interested in WebLogic testresults? I guess yes. ISTR that
> there is also an open TODO to update the FAQ with config info for various
> appservers. I can have a go at that for WL and JBoss.
>


Yes, the patch looks good to me, but verifying that it actually solves the
problem would be good. Sample config files are too large for the FAQ and
should probably be put in the main documentation instead.

Kris Jurka

---------------------------(end of broadcast)---------------------------
TIP 1: if posting/reading through Usenet, please send an appropriate
subscribe-nomail command to majordomo@postgresql.org so that your
message can get through to the mailing list cleanly

Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #9 (permalink)  
Old 04-16-2008, 12:26 AM
Heikki Linnakangas
 
Posts: n/a
Default Re: XA end then join fix for WebLogic

Jan de Visser wrote:
> On Friday 01 December 2006 7:28 am, Kris Jurka wrote:
>> OK. Applied.
>>
>> Kris Jurka

>
> You guys still interested in WebLogic testresults? I guess yes. ISTR that
> there is also an open TODO to update the FAQ with config info for various
> appservers. I can have a go at that for WL and JBoss.


Yes please.

We'll have to think about the format how we want to collect the configs,
but please send what you have so we can start thinking about that. I can
dig my JOnAS test installations for a config file as well. As Kris
mentioned, the documentation stuff isn't that urgent, since it's not
tied to the release of the driver.

--
Heikki Linnakangas
EnterpriseDB http://www.enterprisedb.com

---------------------------(end of broadcast)---------------------------
TIP 4: Have you searched our list archives?

http://archives.postgresql.org

Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On
Forum Jump


All times are GMT. The time now is 05:33 AM.


Powered by vBulletin® Version 3.6.5
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
SEO by vBSEO 3.2.0
www.UnixAdminTalk.com