• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Design pattern for multiple datasources ?

 
Phil Newel
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,
I was trying to figure out the best way to display items from several databases and then place orders which would be a write to multiple databases. Which design pattern is best suited for these two scenarios ? I must use the AppServer datasource connection pool. What can be the possible problems with using EJBs in this situation, if any ?
Cheers !
Phil.N.
 
Rufus BugleWeed
Ranch Hand
Posts: 1551
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I don't believe there's a design pattern for this
particular situation.
Reading data from two seperate databases is no
problem unless your subtracting from an inventory.
Placing an order to two seperate databases is
different. Does the operation need to be a
transaction? I.E. if the order to the second
database fails, the first needs to be rolled back.
This senario is one of the strengths of EJB
technology.
 
Ian Edmondstone
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The Data Object Transfer Factory (Floyd) or the Value Object factory (Core J2EE) is specifically for this purpose.
 
Siva Jagadeesan
Ranch Hand
Posts: 160
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi All:
From what I understand about DTO Factory, is a factory class which could be used to generate DTOs, so that the program would not have to have the logic to generate the DTO. Just another "Indirection" . What I do not understand is how is it going to be useful in case of this scenerio ?!?
It would be great if you could explain more in that.
Thank You
 
Mannu Sureka
Ranch Hand
Posts: 38
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello Phil,
I came across a article on DB2 Magazine.
http://www.db2mag.com/db_area/archives/2002/q2/chen.shtml .
i guess this might be useful to you.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic