I don’t like most of the Flex MVC frameworks cause they force me to write more code. I do like frameworks and tools that let me write less code. But there is no free lunch and, at some point, even productive frameworks, tools, and libraries reach critical mass and the finger pointing game begins.
Today, I’ve been working on an application that was supposed to display a list of orders form a relational DBMS. Not a rocket science. But let’s go over the languages, libraries, tools, and frameworks I had to use for this.
First, I wrote a 20-lines SQL Union statement and tested it in Oracle’s SQL Developer. Then I generated 80% of the code and wrote the other 20% manually. Here’s what I was using:
1. Eclipse IDE for Java EE Developers (Eclipse Foundation), which comes with the WTP plugin
2. CRUD code generator Clear Data Builder (Farata Systems). It generated the initial application written in Java, ActionScript, MXML. It also generated ANT build script
3. Configured Apache Tomcat (Apache Foundation) to run from inside Eclipse – this is where my rich Internet application is deployed.
4. Added to the project the libraries of MyBatis (Clinton Begin and Apache Foundation). This is a light-weight data mapping framework. You map manually written SQL to a Java DTO, which eliminates the need to write JDBC.
5. Spring Framework (Spring Source) was used to simplify wiring of MyBatis into my Java applications.
6. BlazeDS framework (Adobe) is being used for efficient serialization of the server-side Java into client-side ActionScript objects and back via AMF protocol. This exchange happens between the peer ActionScript/Java DTOs.
7. The ActionScript DTOs where automatically generated based on their Java peers by the DTO2FX tool (Farata Systems)
8. Most of the Java code was generated, but I had to write small fragments to be called for data manipulations via SQL/MyBatis
9. The latter would engage the Oracle driver and DBMS (Oracle)
Everything’s ready. Start the server, run the Flex app, and…instead of data I’m getting this error “org.springframework.jdbc.UncategorizedSQLException : Error setting null parameter. Most JDBC drivers require that the JdbcType must be specified for all nullable parameters. Cause: java.sql.SQLException: Invalid column type“.
This error message is misleading. I do insert parameters to the SQL Select, but they are not nulls. I don’t insert anything into the database. The worst part is that there is nothing left to debug. Everything up to the last SQL-annotated Java method declaration works fine. But you can’t debug a method signature, can you? Who is to blame? Oracle driver? Or should I get the source code of MyBatis trying to find the line of the code that blows up?
Enough for today. Going home. I don’t know what’s causing this issue, but I I’ll find the solution. The only question is how much time I’m going to spend on it. Do all these productivity frameworks and tools really save time in the long run? Would I be better off writing JDBC code manually? AS a matter of fact I like MyBatis a lot better than Hibernate, but still…Where are the time savings?