Help coderanch get a
new server
by contributing to the fundraiser
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Ron McLeod
  • Paul Clapham
  • Devaka Cooray
  • Liutauras Vilda
Sheriffs:
  • Jeanne Boyarsky
  • paul wheaton
  • Henry Wong
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Tim Moores
  • Carey Brown
  • Mikalai Zaikin
Bartenders:
  • Lou Hamers
  • Piet Souris
  • Frits Walraven

Distributed Tx and Transactional File Access

 
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi,

I am required to upload/access/move files and also store meta data into multiple database in a single transaction. If an exception is thrown, i have to rollback transaction in all databases and also from file system.

I am using JTA to manage transaction on multiple databases, but have to rollback file system manually in code.

Is there any way where we manage a distributed transaction involving file system and database at a time automatically through transaction manager?

I read about XADisk for transactional file access but am not sure whether it will satisfy my need.

Thanks,
Jay Rajani
 
Greenhorn
Posts: 9
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi Jay,
If I rightly understand the requirement you posted, it must be possible to achieve it with XADisk. In brief, the transaction manager (TM) will need to enlist all the involved resources (multiple databases: [db1, db2, db3]...and the local file-system: [wrapped by xadisk]) with the "global/xa" transaction, and as the TM will pass through its 2PC phases, the involved resources (db1, db2, db3..., xadisk) will fulfill their xa responsibility.

Please refer to the User Guide. The User Guide is a work in progress, so please feel free to ask questions in the XADisk Usage Forum if you have any issues using XADisk, or contact the Project Owner(s).

Thanks,
Nitin (on behalf - https://xadisk.dev.java.net).
 
Jay Rajani
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi Nitin,

Thank you for reply and consideration. You rightly understood my requirement.

I had a look on the guide initially but i could not find information on Connection factory configuration.

The jndi lookup of 'jca/xadiskcf' must be of connection factory. Am i right?

Can you suggest how to configure XADisk Connection Factory on JBoss Application Server?

Regards,
Jay Rajani

 
Nitin Verma Nverma
Greenhorn
Posts: 9
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi Jay,
Sorry, but I haven't worked on JBoss much; I had tested XADisk on Glassfish (and its admin console facilitates creation of connection factories). Probably, you can refer to JBoss documentation on creating connection factories in JBoss; the same approach will apply to all JCA resource adapters including XADisk. In the meantime, I would also remain interested in deploying XADisk onto JBoss.

Thanks,
Nitin.
 
Bartender
Posts: 1638
IntelliJ IDE MySQL Database Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi "Nitin Verma CodeRanch",

Please check your private messages here for an important administrative matter.

Thanks,
Nitesh
 
Nitin Verma Nverma
Greenhorn
Posts: 9
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi Jay,
Out of my curiosity, I too deployed XADisk.rar on JBoss 5.1.0/Java5. The deployment revealed a few changes in ra.xml, which were not caught by Glassfish (Glassfish didn't complain those things). Then, it goes good and I also wrote a simple test-case (managed application) to give a sanity check with JBoss.

I have now uploaded the modified .rar, which you can download and deploy on to GlassFish, JBoss (and any other J2EE server) : Updated XADisk.rar

Now, about your question on connection-factory, I have used the Admin Console (/admin-console) to create a connection-factory for XADisk. It works fine. The links I followed were -
admin-console --> Resources --> Connection Factories --> Tx ConnectionFactories --> Add a new Resource --> Select Resource Template (XA Connection Factory) --> from here, you only need to give these details:
JNDI Name (eg "xadiskcf"), RAR Name ("XADisk.rar" if you haven't renamed after downloading), Connection Definition (org.xadisk.connector.ConnectionFactory). I haven't altered/set other options; so may not comment on them.

Once connection factory gets created, the following sample code in my servlet goes successfully:



On your other question. Yes, in the guide, "jca/xadiskcf" was used to refer to such a connection-factory only.

I hope that should help. Let me know if there are any queries.

Thanks,
Nitin.
 
Nitin Verma Nverma
Greenhorn
Posts: 9
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Correction... <Please refer to my reply below>.
 
Nitin Verma Nverma
Greenhorn
Posts: 9
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Please Note: Regarding my earlier replies, there are a few corrections.

First, please ignore the link to the binary (.rar) file and refer to the project page for new download links.
(Also ignore the link to the User Guide and refer to the project page for all updated information)

Second, there was a change in the package/class name for the connection factory classes. So, the one I mentioned earlier "Connection Definition (org.xadisk.connector.ConnectionFactory)", will not
work. Please refer to the user guide for updated information.

Sorry for the confusion.

Thanks,
Nitin
 
Nitin Verma Nverma
Greenhorn
Posts: 9
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Please note that new URL for XADisk is http://xadisk.java.net/
 
reply
    Bookmark Topic Watch Topic
  • New Topic