Migrating a CORBA Application to Modern Java Technologies (Rest / SOAP / EJB)

I have a requirement to port my legacy CORBA system to any latest Java technology. The main problem that I encountered is to ensure a long-term transaction (db) in the proposed system. Currently, the client (the Swing application) saves the CORBA service object and runs several db txn before committing / rolling back all txn. The service level holds the state of the connection object to complete the transaction.

I wanted to reproduce this mechanism in my new system (REST / WS) so that either the Swing client / Web (future) could work just as it is.

eg:

try { service1.updateXXData(); // --> insert in to table XX service2.updateUUData() //--> insert in to table UU service1.updateZZData(); // --> insert in to table ZZ service2.updateAAData(); // --> insert in to table AA service1.commit(); // con.commmit(); service2.commit(); // con.commmit(); } exception(){ service1.rollback(); // con.rollback(); service2.rollback(); // con.rollback(); } 

Now I wanted to port CORBA to any modern technology, but still I am free to find a solution for this. (the problem is that the client does not want to change the service level or db level), they just wanted to remove CORBA.

Two options are available for me:

  • Transfer CORBA to RMI → so that the changes necessary for the current system are minimal, but transaction management, pooling, state preservation must be done independently.

  • Migrating CORBA to Stateful EJB -> Compare RMI requires more changes, but it is better since I can use the connection pool with a managed container, it is better to maintain state.

  • Porting CORBA to Stateful Webservice (SOAP) -> More futuristic, but many changes are required - How could I convert IDL to WSDL and delegate the call to the implementation level

  • Migrating CORBA to REST -> The most desirable, if possible, but the amount of time required for the migration is huge, code changes will be required from the user interface level to the service level.

Thank you in advance

+6
source share
1 answer

The order in which I would choose options, from best to worst, would be 4, 3, 2, and 1, however I would avoid the state of beans or services if it would be human.

I will talk about the details of the implementation of what you will need to do in detail.

For any of these solutions, you will need to use XA-compatible data sources and transactions so that you can guarantee ACID compliance, preferably from the application server, so you do not need to create the transaction yourself . This should be an improvement from your existing application, since it almost certainly cannot guarantee it, but keep in mind that in my experience, people put a bunch of hacks to substantially rethink JTA, so keep an eye on this.

For 4, you want to use container-managed transactions with XA . You can do this with the @PersistenceContext injection supported by the JTA connection . Yes, it costs tons of time, testing and effort, but it has two bonuses: firstly, moving to the Internet will be much easier, and it looks like this time will come. Secondly, those who come after you are more likely to be well versed in new web service technologies than bare CORBA and RMI.

For 3, you'll also want to use container-managed transactions with XA . SOAP will not be my first choice as it uses very verbose messages and REST is more popular, but it can be done. However, if it is in terms of state, you will have to use beans controlled transactions instead , and then freezing resources through web service calls . This is dangerous because it can potentially slow down the entire system.

For 2, you can go in two ways using container-managed transactions with XA using Faceless session facade for stateful EJBs . You can use the client JAR for your EJB and package with the Swing app. Using a facade without citizenship is preferable, as this will reduce the load on your application server. Keep in mind that you can generate web services from standless EJB beans , essentially turning this into # 3.

For 1 ... well, good luck. You can use RMI to interact with EJB and generate your own stub and tie, although this is not recommended and for a very good reason. It has not been a popular practice for many years, it may require periodic regeneration of stubs and ties, and may require an understanding of the low-level server functions. applications. Even here you will need XA transactions. You do not want to handle transaction management yourself if possible.

Ultimately, I am sure everyone will agree, the choice is yours, what to do, and there is no “right” or “wrong” way, despite the opinions expressed above. If it were me (and it is not), I would ask two important questions about myself and my client:

  • Is it for a contract or temporary participation, and if so, what is the term? Do I get the first choice in another contract for the same system later when they need additional updates? (In other words, how much money am I going to get out of this, and how much time do I spend? If it is a long time, I would go with 4 or 3, otherwise 3 or 2 would be better.)

  • Why get rid of CORBA? “Because he is old” is an honest answer, but what is the impulse to get rid of “old thirst”? Do they plan to expand the use of this system in the future? Is there some kind of license that is expiring and they just want to turn on the lights? Is it because they don’t want to dump it on some younger programmer who might not know how to deal with such low-level things? What do you want the system to do this in two years, five years or longer?

(OK, so more than two questions: D)

+4
source

All Articles