1

I mentioned about this application in my earlier post about PBNI. The application (Tax Software) was written in PB/Java/EAF running on EA Server. It was developed about 8 years ago with the then available technologies. The application is working fine, but there are leftovers from past legacies that I am trying to to clean up code/design.

There is certain code that does database (Oracle) transactions across PB and Java and since the 2 happened to be in different Database (Oracle) sessions, changes in one aren't visible in the other. So, in these cases, the application uses a switch to use PB code for the complete transaction instead of splitting across PB and Java. Otherwise, it uses PB/Java combination.

What this means is that identical sets of program blocks exist in PB and Java. Maintenance nightmare!! I believe PB objects were created first and someone ported those to Java for performance reason (not considering the above split transaction issue). I am trying to eliminate one (probably the PB code, considering performance). I am exploring PBNI in this context.

Please let me know, if any of you faced a similar situation and how you would solve it.

Thanks a lot in advance.

Sam

Doug Porter
  • 7,721
  • 4
  • 40
  • 55
svaratech
  • 241
  • 1
  • 4
  • 17
  • Hi again, To clarify, I am essentially trying to find out, how distributed (database) transaction are handled in general - when you have calls to various programs (or different DBs) all within a single transaction (LUW). EA Server manages such transactions well. But when one (PB) program changes a record and the same record is needed in the other (Java) program, we have a problem. Since commit is done only at the end, the "other" program doesn't see the change yet!! I would like to get expert comments on such a scenario. I appreciate any comments or suggestions. Thanks Sam – svaratech Nov 09 '11 at 18:15

1 Answers1

0

I don't claim to fully understand the nature of your application, but, please consider my comments.

Let PowerBuilder and Java perform necessary updates. It seems to me that you could commit transactions in either system and employ the idea of a logical commit. At the beginning of a transaction, update a column to indicate that the record is logically uncommitted. Java and PowerBuilder take turns updating and committing the record(s). Pass ROWID(s) between the two programs and a SELECT in either program would provide accurate data. When the transaction is logically complete, update the column to logically committed.

As for performance, moving business logic to an Oracle package or stored procedure is never a bad idea. It might take a little planning, but, the same code can run from PowerBuilder OR Java. Plus, there are some outstanding tuning tools for Oracle. Keep your transactions short and commit inside the package/procedure.

Don't be afraid to put logically incomplete transactions in a "work" table and copy the logically complete rows to the "complete" table.

Eric Glenn
  • 389
  • 2
  • 12