Jdeveloper/BC4J



  • Recently I have had the pleasure to work with Oracle's Jdeveloper IDE
    & the BC4J DAO/Object persistance library . These tools are
    supposed to make it super quick to develop oracle based jsp/struts
    apps. Allow me to share one of the many annoyances.



    Database Rows are exposed by a common row interface. This is cool
    because I can now grab an instance of a query, get a row and pass it
    off to the view layer!



    Well at least that's how it's supposed to work. But leave it to Oracle
    to do things backwards. The auto-generated row classes have a property
    for each column in the query and the associated getters/setters.



    Great! that's a java bean now I can simply pass it off to the view
    layer and use the default struts tags to view the bean....but wait,
    it's too good to be true!



    Oracle decided to not follow java bean conventions, but instead capitalize the first letter of each property.

    so:

    what should be:



    String  fieldName;

    becomes

    String FieldName;



    Thank's Oracle!



    Now we can't use any struts bean tags or any beanutils classes without
    first converting the so-called bean to a Map and correcting the case of
    each property.



    Way to go Oracle for completely missing the point of the Java Bean convention!



    I have many more Jdeveloper/BC4J horror stories, anyone else have some?



  • Let me start with this, JDeveloper can be used to create database objects for BC4J entity objects.

    This might work fine and then one of many things can happen:



    a) The view objects complain of being out of synch with the database.
    Synchronising them will then change 'not null' fields to 'null'.



    b) BC4J mapping files may be f*cked up such that the domain types don't
    match the database columns types and the error messages / stack traces
    are completely misleading. For example a numeric column was defined as
    a character domain type in the XML files. The stack trace said
    'ArrayIndexOutOfBounds'.

    Why does BC4J throw unchecked exceptions that can cause a production server to hang?



    c) Contraints are automatically generated by JDeveloper but can't be
    created in the database because the names are too long. There is no way
    of editing the constraints or changing the names. If you override the
    SQL definitions then BC4J view objects will not work.



    I was bullied into leaving Hibernate for BC4J. Now I will never use it again.

    It speaks volumes that Oracle will be using TopLink for EJB3 persistance in the next release of 10g.



    ADF (BC4J + Struts + Java Server Faces) + Portal - if you every get this working you are my hero.



    Struts + Portal is barely working. You only lose your portlet session every now and then for no apparent reason at all.

    And only by writing a servlet filter to verify the madness was my sanity restored.



Log in to reply
 

Looks like your connection to What the Daily WTF? was lost, please wait while we try to reconnect.