Tuesday, May 17, 2011

OrindaBuild is now called "JDBCWizard"...

See: JDBCWizard Announcement.

Internally there have been no changes other than the name.

Friday, October 29, 2010

Null oracle.jdbc.pool.OracleDataSource Returned Unexpectedly

Issue: Customer got NullPointerException in generated method 'getConnectionFromDataSource'


Analysis: Oracle's connection pool returns Null if no Connection is available and timeout is exceeded



Resolution: OrindaBuild 6.0.2723 catches the NullPointerException and casts it to a usable Exception

Friday, July 2, 2010

ORA-22990 When trying to open a returned CLOB or BLOB


Issue: Customer needs to access oracle.sql.CLOB objects instead of byte[]. They can get the oracle.sql.CLOB object from the DAO Factory class but get the following error when then try and open the clob in read/write mode:

 


//Get DAO object

c.generated.plsql.JavaTestChangeTestDocument d = 

s.getJavaTestChangeTestDocumentPlSqlDAO();


// We're going to retrieve CLOB with ID of 1.

d.setParamPId(1);


// Call stored procedure that gets the CLOB.

d.executeProc();


// Get CLOB we retrieved

oracle.sql.CLOB c2 = d.getParamPDocumentClob();


// This line throws a SQLException with

// ORA-22990: LOB locators cannot span transactions

c2.open(oracle.sql.CLOB.MODE_READWRITE);

 



Analysis:

 


Prior to 11.2 Oracle's JDBC drivers throw "ORA-22990: LOB locators cannot span transactions" when an attempt is made to modify a CLOB or BLOB and autocommit is turned on. 11.2 appears to tolerate this. This isn't a bug but OrindaBuild should check for this and make an appropriate complaint at run time if the provided connection has autocommit=true, as the Oracle error text is cryptic. Changing the commit properties of the connection was considered and rejected because of the near-certainty of side effects.

 


Resolution:

 


OrindaBuild needs to trap and reword this error.


Wednesday, June 30, 2010

CURSORS as IN Parameters need to be supported

Issue:


Customer needs to call legacy PL/SQL from Java. Due to the limitations of Delphi (which was originally used before Java was adopted) all "OUT" parameters had to be defined as "IN OUT". This is a significant issue if the parameter in question is a Cursor:




procedure View_Array_Varchar2

  (p_Cursor in out t_Cursor, 

   p_Array_Varchar2 in t_array_varchar2); 





 


Customer was able to generate un-runnable code using OrindaBuild for this situation. Messages at runtime was:





execution failed: com.orindasoft.pub.CSException:


Attempt to set a non-existant parameter number 3;

 legal range is '1' to '2'




 


We don't support cursors as input parameters for several reasons:





  • The concept is a little strange if you calling are PL/SQL from outside the database itself. It's plausible that within PL/SQL procedure 'A' will create a cursor and pass it as a parameter to procedure 'B', but don't see it being used for calls from outside the DB. .

  • Once you go through a web service or JSP page we don't see how it can work at all. A Cursor is in fact a handle to a resource in an Oracle database instance.
  • As a matter of practicality Oracle's JDBC driver does not allow you to bind a cursor as an IN parameter.


 


Workaround:

The simplest solution was to change the PL/SQL so that cursor parameters were OUT only. We didn't think this was acceptable.

 


Resolution:

Build 2704 allows Cursors as IN parameters but ignores any values passed in. This meets the customers need's (they never pass anything in) without trying to do anything impossible in JDBC.

Wednesday, March 3, 2010

SQL Developer Extension - Incorrect default value for root directory

Issue: Root directory for Java code has incorrect default of "//src" in SQL Developer 2.1.1.64


Workaround: Change the default directory


Resolution: Unresolved

JSR181 - @WebMethod tag needed but not being generated

Issue: According to the JSR181 spec the @Webmethod tag isn't needed but in practice it is. The spec says:


The @WebService tag marks a Java class as implementing a Web Service. @WebMethod tags identify the individual methods of the Java class that are exposed externally as Web Service operations



This clearly means that without an @WebMethod tag a method should not be exposed. But in tests with Java 1.6 all public methods were exposed whether they had "@WebMethod" or not. This creates a problem, as OrindaBuild generated Web Service classes have several public methods which are not supposed be turned in to a service.



Resolution: Fixed in OrindaBuild 6.0.2699. We fixed this by getting the class level @WebService tag to specify an endpoint interface, which lists all the public methods that are supposed to be in the service. We also have an example of JSR181 Web Service code that shows how endpoint interface is used:

@WebService(endpointInterface = 

"com.orindasoft.demo.generated.DAOFactoryServiceInterface") 


Tuesday, March 2, 2010

NumberFormatException when retrieving LOBs with Java 1.5

Issue: java.lang.NumberFormatException is thrown when using Java 1.5 and returning a cursor containing a CLOB, BLOB, LONG or BFILE


Analysis:
Prior to Java 1.5 an attempt to convert a number > 2GB to an int would lead to a
java.lang.NumberFormatException whose message was a String containing the number that was too big.
In Java 1.5 this changes and the number is embedded in the middle of an error message such as:

For input string: "value"

NumberFormatException is thrown by the getPrecision

method of Oracle's ResultSetMetaData class when the column is a BFILE, CLOB or BLOB. The
constructor for com.orindasoft.pub.ReadOnlyRowSet catches it and extracts the number from the Exception text.
This step was failing for Java 1.5 until we added code to strip out the new message text before trying to turn it into a number.

Resolution:
A new build (5.0.2070) which fixes this bug has been deployed.

"Problem Opening Wizard" Modal Message

Issue:
When you try to start OrindaBuild from within Eclipse you get a "Problem Opening Wizard" Modal Message

Eclipse 2.1.3 Error Message


Workaround:


Resolution:
Not a bug. This is known to occur when you attempt to use the Plugin with Eclipse 2.1.3. OrindaBuild is not supported on Eclipse versions prior to 3.0.0. If you get this with Eclipse 3.0 please contact our support team.

The OrindaBuild extension remains a demo when you install the full version

Issue:
If you install the Demo version of OrindaBuild's JDeveloper extension and then upgrade to the full version nothing appears to happen.


Workaround:


Resolution:
In order for the licence code to be accepted you need to press the Reset Licence Code button on the

OrindaBuild Preferences screen
screen. We have amended the documentation to make this clearer.

OrindaBuild runs slowly when generating code for a large number of tables.

Issue:
OrindaBuild slows down noticably when asked to generate code for a large number of tables.


Workaround:


Resolution:
We identified and fixed a poorly performing SQL statement. It now uses the right index and has been tested against over 1000 interrelated tables without any issues.