ibatis-user-java mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Clinton Begin" <clinton.be...@gmail.com>
Subject Re: Urgent!!!! problem with Result Map.
Date Wed, 01 Aug 2007 13:38:53 GMT
Ok, your post frightens me a bit....

First to your question: "java.sql.SQLException: No data found" is a JDBC
exception that occurs when you attempt to call a ResultSet method like
getString() when there is no more data available (i.e. resultSet.next()
returns false).  Unfortunately it's so generic that it could be
anything.  My guess is that for that 1:1 relationship iBATIS fully expects
it to be there.  Instead it's not finding the row and may be calling data
methods anyway assuming it should be there.  But I doubt that, as iBATIS
never calls those methods unless rs.next() returns true.  It could be a
driver issue or an odd SQL/database issue.

Here's the thing.  The version of iBATIS you're using is absolutely ancient
-- at least 3.5 years old!  We simply cannot support that with any degree of
confidence anymore.  The entire software stack including the JVM, app
servers, JDBC drivers and databases have all changed so much that one of two
things is true:  1) iBATIS is the only thing that old in your stack, and
therefore has simply fallen behind and we can't begin to guess at the
problems.  or 2) your whole stack is that old and we simply cannot remember
or begin to guess an what could be going wrong because we've all moved on.

In the first case, you really should upgrade iBATIS at any cost.  For years
we had conversion tools that would help you move to the new platform.  We've
stopped supporting even those tools because it's just so old.  Otherwise, if
your whole stack is that old...you might just be on your own unless you can
find someone else who is also running stuff that old.

You can download the source code and step through it with a debugger if
necessary to figure out what might be happening.  If it does turn out to be
a bug you might have to patch it yourself and rebuild it.  But I really do
doubt that a bug that fundamental would exist in software that old without
anyone else noticing.

As for the "realtime application" -- I hope you're not serious about that.
First of all, Java itself is not terribly good for realtime applications and
certainly not iBATIS that old.  Plus, the setup you have with the SQL right
now could lead to an N+1 selects problem that could cause exponential delays
in your application performance.

I wish we could be of more help, but this is a bit of foundational problem
that is not easy to even begin solving. :-/

Cheers,
Clinton


On 8/1/07, Prince V. K. <prince.vk@patni.com> wrote:
>
>
>
>
> Hi All,
>
>
>
> I have two tables account and address. I have two objects Address.java and
Account.java. I am populating the value from address table into
Address.javabut keeping an instance of Address class in
Account.java as "address". I created the map statements and done all the
configurations correctly. I have two xml files both are included in the
configuration file also. The map statements are
>
>
>
>  // Account.xml
>
>  <result-map name="account-result" class="examples.domain.Account">
>
>  <property name="id" column="ACC_ID" />
>
>  <property name="firstName" column="ACC_FIRST_NAME"/>
>
>  <property name="lastName" column="ACC_LAST_NAME"/>
>
>  <property name="emailAddress" column="ACC_EMAIL" null="
no_email@provided.com"/>
>
>  <property name="address" column="ACC_ID"
mapped-statement="getAddressForAccount" />
>
>  </result-map>
>
>
>
>  <mapped-statement name="getAccounts" cache-model="account-cache"
result-map="account-result">
>
>  select * from ACCOUNT
>
>  where ACC_ID = #value#
>
>  </mapped-statement>
>
>
>
>  //Address.xml
>
>  <mapped-statement name="getAddressForAccount"
>
>  result-class="examples.domain.Address">
>
>  select
>
>  ADR_ID as id,
>
>  ADR_DESCRIPTION as description,
>
>  ADR_STREET as street,
>
>  ADR_CITY as city,
>
>  ADR_PROVINCE as province,
>
>  ADR_POSTAL_CODE as postalCode
>
>  from ADDRESS
>
>  where ADR_ACC_ID = #value#
>
>  </mapped-statement>
>
>
>  The tables are
>
>  CREATE TABLE ACCOUNT (
>  ACC_ID INTEGER NOT NULL,
>  ACC_FIRST_NAME TEXT,
>  ACC_LAST_NAME TEXT,
>  ACC_EMAIL TEXT,
>  PRIMARY KEY (ACC_ID)
>  );
>
>  CREATE TABLE ADDRESS (
>  ADR_ID INTEGER NOT NULL,
>  ADR_ACC_ID INTEGER NOT NULL,
>  ADR_DESCRIPTION TEXT,
>  ADR_STREET TEXT,
>  ADR_CITY TEXT,
>  ADR_PROVINCE TEXT,
>  ADR_POSTAL_CODE TEXT,
>  PRIMARY KEY (ADR_ID)
>  );
>
>
>
>
>  The java statement is
>
>  List list = sqlMap.executeQueryForList("getAccounts", new Integer(1));
>
>
>
>  it is showing the error as
>
>  ERROR [main] - Error executing 'getAccounts' in
'examples/sqlmap/maps/Account.xml'. Check the Result Map. Check the
'address' property. Cause: java.sql.SQLException: No data found
>  java.sql.SQLException: No data found
>  at com.ibatis.db.sqlmap.MappedStatement.runQueryForList(
MappedStatement.java:677)
>  at com.ibatis.db.sqlmap.MappedStatement.executeQueryForList(
MappedStatement.java:581)
>  at com.ibatis.db.sqlmap.MappedStatement.executeQueryForList(
MappedStatement.java:561)
>  at com.ibatis.db.sqlmap.SqlMap.executeQueryForList(SqlMap.java:784)
>  at examples.sqlmap.QueryForListExample.queryForListExample(
QueryForListExample.java:30)
>  at examples.sqlmap.QueryForListExample.main(QueryForListExample.java:66)
>  Exception : java.sql.SQLException: No data found
>
>  Can anybody please let me know about the actual problem that I am facing.
I need to do it in my realtime application and to move it in production. So
please let me know about the problem ASAP. I need the two different queries
from different tables combined in one Object.
>
>
>
>  Any help will be appreciable
>
>
>
>
>
>  Regards,
>
>
>
>  PRINCE V. K.
>
>
>
>
> Regards,
>
>
>
> PRINCE V. K.
>
> Sr. Engineer (Software)
>
> Desk No: 106, 1st Floor, E-Block, PKP
>
> Airoli, New Mumbai - 708
>
>
>
> Link Line:  9 625 6306
>
> Mob: 9833855754
> http://www.patni.com
>  World-Wide Partnerships. World-Class Solutions.
>  _____________________________________________________________________
>
>  This e-mail message may contain proprietary, confidential or legally
privileged information for the sole use of the person or entity to whom this
message was originally addressed. Any review, e-transmission dissemination
or other use of or taking of any action in reliance upon this information by
persons or entities other than the intended recipient is prohibited. If you
have received this e-mail in error kindly delete  this e-mail from your
records. If it appears that this mail has been forwarded to you without
proper authority, please notify us immediately at netadmin@patni.com and
delete this mail.
>  _____________________________________________________________________

Mime
View raw message