Xcalia article on complex object-relational mapping

Discussions

News: Xcalia article on complex object-relational mapping

  1. Xcalia Intermediation Core (formerly known as LiDO), which supports JDO (1.0 & 2.0 preview), SDO (1.0), and soon the EJB 3.0 Persistence API, has supported complex object-relational mapping options for quite some time.

    Topics highlighted are:
    • Optimal table-per-hierarchy class mapping
    • Collections containing heterogeneous elements, including interface types and java.lang.Object
    • Persistent user-defined interfaces
    • Classes unrelated via inheritance stored in the same table
    • Overrideable package- and/or project-level mapping strategies
    • Maps with keys of enumeration types and values of interface types
    Read the article here (requires site registration). It comes with downloadable source code and build files so that you can run it yourself and tweak it.

    What do you think of the feature list? Are mappings like this useful to you? Have you considered such mapping capabilities before?

    Threaded Messages (17)

  2. OMG = prepetual motion machine?[ Go to top ]

    <eom>

    .V
  3. I don't feel like registering, so if any Xcalia guys are reading this thread I got a question for you.

    Does your product support Oracle Type Tables and Database Objects. If so does it support calling them from PL/SQL?


    And to TTS, I say this article last week, and then it was gone. You guys playing peek-a-boo with your articles, and why is has you site be down so often lately?
  4. Matt, I'm sorry, but I'm a little puzzled by your question...... Xcalia is a java o/r mapping framework. I assume you actually know what that is, so can you please elaborate on the subject and explain why you'd like to use a java O/R mapping framework from within PL/SQL code? I'd really like to know more about your use case.

    cheers,
    Emil. (http://www.thekirschners.com/)
  5. Yes I do know what ORM is, and I should have done a better job of wording my question. On 2nd thought I should not have posted anything at all.

    For the sake of proving I'm crazy, and giving everyone something to laugh at I will give you an idea of what I have had to deal with for the last 2 years.

    First let me say that I work almost 100% in Oracle shops. My use case is based on this crazy customer requirement that I keep running into. In the last 3 places I have worked the customer is wanting to web enable legacy database applications. They want a DHTML front-end, java middleware, and want 100% of their business and data logic written in PL/SQL. In all three cases the customer already owned a copy of the Oracle Application Server to run all their Oracle Reports, so all we had to do was write the app and publish.

    All three places had PL/SQL developers that had been working with these applications and data for years. They knew the data and business logic of the application inside and out, but where at pretty much at a loss when it to web enabling their PL/SQL. I (and others) were brought in to help.

    We actually had quite a few options:

    - Fine grained PL/SQL procedures: Not really an option because in many cases the result of calling the business logic would be large amounts of structured data.

    - Pass the data in and out of PL/SQL as an XML String: It became clear very quickly that this approach was too prone to typos, plus it cluttered the PL/SQL code and caused readability problems.

    - Pass the data in and out of PL/SQL as a Native XMLType Object. The two main problems with this is that we found that Native XMLType objects had performance problems in some circumstances, and it made the PL/SQL code very wordy. Plus anyone who has had to do a lot of DOM programming will tell you it sucks (in any language).

    - Pass the data out of PL/SQL as a Ref-cursor and back into PL/SQL as a using find grained procedures. This at first seemed the best solution, but it turned out that in many cases the business logic could not always be returned as one SQL statement (required when using a ref-cursor), and the sometimes the data coming back to PL/SQL was structured (which killed using fine grain procedures).

    The solution that we found worked the best was to pass Oracle Type Tables and Oracle Database Objects in and out of PL/SQL business methods. You can think of a Type Table as a Collection, and think of a Database Object as a value object. They work with standard Oracle JDBC thin drivers, and allowed us to pass large amounts of structured data back and forth between Java and PL/SQL. Also there was almost no learning curve for the PL/SQL developers, they became productive developing in this env in a matter of days (once we had a good set of examples worked out). And their was very little learning curve for Java developer (once we had working examples). There were really only three side affects of method of development:

    1) Type Tables and Database Objects had to be defined in the database. I saw this as a benefit, it was like a written contract between the PL/SQL and Java developers, but a few of the PL/SQL developer thought it was messy that we had to create all of these objects just to move data.

    2) The database used more memory. The memory increase was due to the fact that Type Tables and Objects have to be populated in memory before they can be passed, unlike a ref-cursor that can just stream out of the database using very little memory. We only saw a 5% increase in memory. We knew there would be an increase so we base lined the system before switching over to using the Type Table and Database Objects.

    3) Working with Type Tables and Database Objects, requires you to do everything in raw JDBC using CallableStatements, StructureDescriptors, and ArrayDescriptors. Programing DAO's this way is very wordy, tedious, and boring.

    I'm looking to find a way to fix the "very wordy, tedious, and boring" part. I know Xcalia will do nothing to address this. Like I said I have no idea why I even posted my orig reply. I think that I could probably write a small utility framework to clean up 80% of the code in the DAO. I'm just the kind of guy that likes to not reinvent the wheel for nothing, so I want to make that before I spend all the effort I'm 100% sure that someone has not already written something to handle this.

    I bet that Java people are going to be horrified after reading this, but I must admit that they PL/SQL developer involved in these projects have been very happy with the applications. The only time Java changes are needed is when screen changes are needed. This allows them to change, optimize, and fix back-end easily and quickly.
  6. Oracle Type Table and Database Objects[ Go to top ]

    Matt, interesting story.
    Why "simple" Oracle record (..of records,..of records)
    was not considered for jdbc transportation?
    Objects (in general) are selected over
    data structures when in need of inheritance
    and behaviour. Were objects choice of convinience
    or of desing?
    THanks.

    Alex V.
  7. Oracle Type Table and Database Objects[ Go to top ]

    Why "simple" Oracle record (..of records,..of records) was not considered for jdbc transportation?

    We did test using records, but were not able to successfully send structured data (records of records of..) from Java back to PL/SQL using the thin driver. Not that it can't be done, just seams like there are very limited examples out there to go off. Have you ever gotten that to work, or do you know of an example that you could provide a link to?

    Thanks,

    ~Matt
  8. I am not sure about thin driver, but see oracle JDBC examples. All "advanced" oracle JDBC features are demonstarated by examples.
  9. And to TTS, I say this article last week, and then it was gone. You guys playing peek-a-boo with your articles, and why is has you site be down so often lately?

    They changed over how the site is hosted a while back.

    Peace,

    Cameron Purdy
    Tangosol Coherence: Clustered Shared Memory for Java
  10. "Complex" ORM[ Go to top ]

    Is that what were looking for?

    Will "complex" ORM replace the need for SQL and stop generating too many SQL statements and poor mapping performance?
  11. To win the ORM race - Native Queries[ Go to top ]

    Is that what were looking for?Will "complex" ORM replace the need for SQL and stop generating too many SQL statements and poor mapping performance?

    Of course not.

    The ORM race will be won by the ORM product that excels in giving the people who use ORMs what they want in the first place: OO.

    Even the latest EJB 3.0 "transparent" persistence spec defines queries in a way that is completely intrusive, encapsulation-breaking, string-based, injection-attack-prone, weakly typed and inapropriate
    for refactoring tools.

    Why can't I just write my queries in pure Java, and have the ORM optimize that to use indexes and to optimize the data access path?

    "Because that is impossible."

    Hm. Really? Take a look:
    http://www.db4o.com/about/productinformation/whitepapers/Native%20Queries%20Whitepaper.pdf

    See you, Klaus.
    db4objects - "Objects Are Here to Stay"
    Prevayler - "Databases in Memoriam"
  12. Klaus, do you think we could get you in a room with Vic and Juozas to work this one out?

    Peace,

    Cameron Purdy
    Tangosol Coherence: This space available.
  13. To win the ORM race - Native Queries[ Go to top ]

    But how would you argue with someone who was able to build a product that is 9000 times faster then Oracle?
  14. To win the ORM race - Native Queries[ Go to top ]

    I see no problems in this stuff, I like to experiment for fun myself.
  15. I am not sure about thin driver, but see oracle JDBC examples. All "advanced" oracle JDBC features are demonstarated by examples.

    I was not able to find an example that showed using Records to pass database back and fourth between Java and PL/SQL. I only found examples using that show using the Database Objects that I'm already using.

    **Is it just me or are other people getting tired of getting RMI errors when trying to post to TTS?
  16. **Is it just me or are other people getting tired of getting RMI errors when trying to post to TTS?
    Do not click on personalized pages like "My Threads" it looks like this stuff leaks database connections, please use cached pages :)
  17. BTW I am not sure, but looks like you are looking for this stuff
    http://www.oracle.com/technology/sample_code/tech/java/sqlj_jdbc/files/9i_jdbc/MultipleCollectionSample/MultipleCollectionSample.java.html
  18. We have been using XCalia/LiDo for quite some time. Their support is quite fast, but it needs to be fast, because the number of bugs has been overwhelming. Sure they are getting better, but we are still fighting with some of the issues. As a freelancer, I would never propose to use LiDo in another project.