Unix Technical Forum

making the XARessource serializable

This is a discussion on making the XARessource serializable within the pgsql Interfaces jdbc forums, part of the PostgreSQL category; --> Is there any reason that the postgresql implementation of XAResource is not serializable? We are having issues with XARecovery ...


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

FAQ Members List Calendar Search Today's Posts Mark Forums Read
  #1 (permalink)  
Old 04-16-2008, 12:54 AM
teknokrat
 
Posts: n/a
Default making the XARessource serializable

Is there any reason that the postgresql implementation of XAResource is
not serializable? We are having issues with XARecovery in Arjuna because
of this. What is required to make PGXAConnection serializable?

cheers


---------------------------(end of broadcast)---------------------------
TIP 5: don't forget to increase your free space map settings

Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #2 (permalink)  
Old 04-16-2008, 12:54 AM
Heikki Linnakangas
 
Posts: n/a
Default Re: making the XARessource serializable

teknokrat wrote:
> Is there any reason that the postgresql implementation of XAResource is
> not serializable? We are having issues with XARecovery in Arjuna because
> of this. What is required to make PGXAConnection serializable?


PGXAConnection represents a physical connection to the database, so you
certainly can't make that Serializable.

What kind of issues are you having in Arjuna? It can't depend on
serialization of XAResources; there's nothing in the spec saying an
XAResource implementation needs to be serializable, and a quick look at
other DBMS XAResource implementations suggests that they generally aren't.

--
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
  #3 (permalink)  
Old 04-16-2008, 12:54 AM
teknokrat
 
Posts: n/a
Default Re: making the XARessource serializable

Heikki Linnakangas wrote:
> teknokrat wrote:
>> Is there any reason that the postgresql implementation of XAResource is
>> not serializable? We are having issues with XARecovery in Arjuna because
>> of this. What is required to make PGXAConnection serializable?

>
> PGXAConnection represents a physical connection to the database, so you
> certainly can't make that Serializable.
>
> What kind of issues are you having in Arjuna? It can't depend on
> serialization of XAResources; there's nothing in the spec saying an
> XAResource implementation needs to be serializable, and a quick look at
> other DBMS XAResource implementations suggests that they generally aren't.
>


From what i have managed to make out, Arjuna has a xa recovery module
that can recover resources if the XAResource is serializable. Things get
more complicated if its not. I've recompiled the jdbc drivers, making
PGXAConnection serializable and it worked. This is a link illustrating
the behaviour we were getting
http://wiki.jboss.org/wiki/Wiki.jsp?...ableXAResource



---------------------------(end of broadcast)---------------------------
TIP 5: don't forget to increase your free space map settings

Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #4 (permalink)  
Old 04-16-2008, 12:54 AM
Heikki Linnakangas
 
Posts: n/a
Default Re: making the XARessource serializable

teknokrat wrote:
> From what i have managed to make out, Arjuna has a xa recovery module
> that can recover resources if the XAResource is serializable. Things get
> more complicated if its not. I've recompiled the jdbc drivers, making
> PGXAConnection serializable and it worked.


What exactly did you do to "make PGXAConnection serializable"? If you
just add "implements Serializable", you'll get an
NotSerializableException when you actually try to serialize it.

> This is a link illustrating
> the behaviour we were getting
> http://wiki.jboss.org/wiki/Wiki.jsp?...ableXAResource


According to that, you need to provide an implementation of
com.arjuna.ats.jta.recovery.XAResourceRecovery. Apparently there's a
simple implementation that looks up the XADataSource implementation with
JNDI. See JBoss Transaction API Programmers Guide, chapter 4, title
"Shipped XAResourceRecovery implementations".

I'm surprised Arjuna/JBoss doesn't just connect to every database listed
in JNDI, or at least all those that were used in the transactions that
need recovery. That's what other app servers do, I believe.

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

---------------------------(end of broadcast)---------------------------
TIP 7: You can help support the PostgreSQL project by donating at

http://www.postgresql.org/about/donate

Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #5 (permalink)  
Old 04-16-2008, 12:54 AM
teknokrat
 
Posts: n/a
Default Re: making the XARessource serializable

Heikki Linnakangas wrote:
> teknokrat wrote:
>> From what i have managed to make out, Arjuna has a xa recovery module
>> that can recover resources if the XAResource is serializable. Things get
>> more complicated if its not. I've recompiled the jdbc drivers, making
>> PGXAConnection serializable and it worked.

>
> What exactly did you do to "make PGXAConnection serializable"? If you
> just add "implements Serializable", you'll get an
> NotSerializableException when you actually try to serialize it.
>


belive or not, thats exactly what i did. I thought that the
BaseConnection instance would stuff things up but it hasn't. No idea why.

>> This is a link illustrating
>> the behaviour we were getting
>> http://wiki.jboss.org/wiki/Wiki.jsp?...ableXAResource

>
> According to that, you need to provide an implementation of
> com.arjuna.ats.jta.recovery.XAResourceRecovery. Apparently there's a
> simple implementation that looks up the XADataSource implementation with
> JNDI. See JBoss Transaction API Programmers Guide, chapter 4, title
> "Shipped XAResourceRecovery implementations".


yeah, the JDBCXARecovery module. I guess I'll have to llok into that.
The problem for us being that our password can't be in plaintext.

> I'm surprised Arjuna/JBoss doesn't just connect to every database listed
> in JNDI, or at least all those that were used in the transactions that
> need recovery. That's what other app servers do, I believe.
>


that would be good.


---------------------------(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
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 02:57 PM.


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