Re: queryForList

2005-11-07 Thread Pham Anh Tuan

an empty list :)


*
Pham Anh Tuan
Java Developer, HR Assistant
ICHI Corporation Vietnam.
Room #1001, 37 Ton Duc Thang, Dist. 1
Ho Chi Minh City, Vietnam.
Phone: (+84) (08) 9105732
Fax: (+84) (08) 9105734
Cell: (+84) (0) 989 505897
Email: [EMAIL PROTECTED]
Website: http://www.ichi-corp.jp
*
- Original Message - 
From: "Paul Benedict" <[EMAIL PROTECTED]>

To: 
Sent: Tuesday, November 08, 2005 11:59 AM
Subject: queryForList



Does this method return an empty list or null if nothing is found?



__ 
Yahoo! FareChase: Search multiple travel sites in one click.

http://farechase.yahoo.com






queryForList

2005-11-07 Thread Paul Benedict
Does this method return an empty list or null if nothing is found?



__ 
Yahoo! FareChase: Search multiple travel sites in one click.
http://farechase.yahoo.com


Re: iBatis with JNDI and WebSphere and MS-SQL Server

2005-11-07 Thread Jeff Butler
iBATIS *always* closes connections - something else must be going on.
 

Please send your sqlmapconfig file showing how the data source is configured.
 
In my experience, WebSphere needs the attribute "SetAutoCommitAllowed" set to false.  See here:
 
http://opensource2.atlassian.com/confluence/oss/display/IBATIS/Environment+Specific+Information
 
Here's how to do logging:
 
http://opensource2.atlassian.com/confluence/oss/display/IBATIS/How+do+I+Configure+Logging+in+WebSphere

 
This is for WAS 6.0, but the principles are the same for WAS 5.0.
 
Jeff Butler
 
On 11/7/05, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote:
All,I'm having a really odd problem that I would greatly appreciate help with.  Mycompany is trying to use JNDI with WebSphere targeting MS-SQL Server.  In
short, when the web session times out, a read to an authentication databasecauses that database to be locked to such an extent that no other sessions,users, or clients can even do a read on those database tables.  Due to the
trace log messages, IBM is convinced that 'my' code is not closing the databaseconnections, and says that I should correct my code.  Well, I'm using iBatis,and it's pretty clear to me after looking at the source that those connections
should be closing.  IBM has suggested a work-around which will causeuncommitted transactions to commit rather than rollback.  I have managed toconvince them, I think, that a rollback should not do what it is doing
regardless of my actions.  This may 'fix' my problem, but they remain adamantthat I am not properly closing my database connections and that I shouldcorrect my code.Below are some of the specific, but condensed, details about what I am trying to
do.  As I have been working with IBM on a PMR for about 10 weeks, copiousdetails are also available upon request including a sample war file and tracelogs from WebSphere.Background:•   Target production server is WebSphere 
5.1.1.4 on iSeries, but problem wasfound on WS5.1.1.4 for Windows•   User authentication is through Windows domain•   Group has been using iBatis for approximately 2 years now
•   MS-SQL Server 2000•   Application is 'intranet' onlyApplication•   First, Java web application forwards to a specifically created MS-IISapplication.  The Windows user name is then written to a 'GateKeeper' database
using the jsession id as the key.  IIS application then forwards back to thejava web application. (That way, no security information is passed directlyback to the java web application.)•   Java web application reads the security information associated with the user
based upon the jsession id.  Security string (xml) is stored in the sessiondata.•   User may then perform queries against the 'pubs' database.  (MS-SQL standardtesting database, deployed by default with every MS-SQL server.)
•   When the web session times out, if a user attempts to perform another query,they are forwarded to a notification page.  The user may then click to bere-authenticated, and it all starts over again.
Problem details:•   If the web session times out, and the user clicks to follow the link tore-authenticate, then the database tables are locked.  This is veryduplicatable; it happens every single time.
•   Locks are for the entire table, and prevent any query action whatsoever•   Problem has been on WebSphere 5.1.1.4 and WebSphere 5.1.1.6 on Windows.
•   Problem occurs with both MS JDBC drivers and WebSphere embedded drivers•   Problem only occurs using JNDI.•   Using JDBC with iBatis without JNDI does not exhibit any problems.•   Problem will only occur if read of pubs database occurs
•   "Kill spid" command from SQL Server will terminate the connection and free allusers.  Otherwise, only stopping the entire server will kill the connection.•   In trace log, IBM notes the following:  WebAppTransac E WTRN0043I:
LocalTransaction rolled-back due to setRollbackOnlyIBM has a tech note athttp://www-1.ibm.com/support/docview.wss?uid=swg21141640  which they contend
will fix the problem.  Unfortunately, it will also cause an automatic commit ofa transaction, if the developer was careless and an exception occurs.•   No other exceptions or anomalous events occur
Questions•   Under what circumstances will iBatis not 'close' database connections, i.e.,return them to the pool?•   Am I missing something that I need to do in iBatis that wasn't required whennot using JNDI?
•   How do I set up logging for iBatis under WebSphere?  Can this be done as partof the trace file so that it is all packaged together?Thanks in advance for anyone who has the patience and time to look at this.  I
realize that this is rather lengthy, but I also realize that it may not benearly enough information to determine what is actually going on.Thanks!Rich


Re: confused about storing image data in my database

2005-11-07 Thread Alan Chandler
On Monday 07 Nov 2005 23:10, Jeff Butler wrote:
> Ah...sorry.
>  This is sometimes hard to work through. The problem is that bytea doesn't
> map easily to a JDBC type - hence the posgresql documentation telling you
> exactly what JDBC method to call. If bytea means that you should call
> getBytes(), then I think you should use a byte[] in your bean, but NOT
> specify type of BLOB in the result map. This will cause iBATIS to use the
> ByteArrayTypeHandler, which calls getBytes().
>  You can see how iBATIS decides what to do by looking at the class
> com.ibatis.sqlmap.engine.type.TypeHandlerFactory. If there is a property of
> type byte[], and JDBC type is not BLOB or LONGVARBINARY, then iBATIS will
> use the ByteArrayTypeHandler - which should do what you want.
>  I hope I understand it this time :)

Thanks that is exactly what I was after.

-- 
Alan Chandler
http://www.chandlerfamily.org.uk
Open Source. It's the difference between trust and antitrust.


iBatis with JNDI and WebSphere and MS-SQL Server

2005-11-07 Thread ibatis
All,

I'm having a really odd problem that I would greatly appreciate help with.  My
company is trying to use JNDI with WebSphere targeting MS-SQL Server.  In
short, when the web session times out, a read to an authentication database
causes that database to be locked to such an extent that no other sessions,
users, or clients can even do a read on those database tables.  Due to the
trace log messages, IBM is convinced that 'my' code is not closing the database
connections, and says that I should correct my code.  Well, I'm using iBatis,
and it's pretty clear to me after looking at the source that those connections
should be closing.  IBM has suggested a work-around which will cause
uncommitted transactions to commit rather than rollback.  I have managed to
convince them, I think, that a rollback should not do what it is doing
regardless of my actions.  This may ‘fix‘ my problem, but they remain adamant
that I am not properly closing my database connections and that I should
correct my code.

Below are some of the specific, but condensed, details about what I am trying to
do.  As I have been working with IBM on a PMR for about 10 weeks, copious
details are also available upon request including a sample war file and trace
logs from WebSphere.

Background:
•   Target production server is WebSphere 5.1.1.4 on iSeries, but problem 
was
found on WS5.1.1.4 for Windows
•   User authentication is through Windows domain
•   Group has been using iBatis for approximately 2 years now
•   MS-SQL Server 2000
•   Application is ‘intranet’ only

Application
•   First, Java web application forwards to a specifically created MS-IIS
application.  The Windows user name is then written to a ‘GateKeeper’ database
using the jsession id as the key.  IIS application then forwards back to the
java web application. (That way, no security information is passed directly
back to the java web application.)
•   Java web application reads the security information associated with the 
user
based upon the jsession id.  Security string (xml) is stored in the session
data.
•   User may then perform queries against the ‘pubs’ database.  (MS-SQL 
standard
testing database, deployed by default with every MS-SQL server.)
•   When the web session times out, if a user attempts to perform another 
query,
they are forwarded to a notification page.  The user may then click to be
re-authenticated, and it all starts over again.


Problem details:
•   If the web session times out, and the user clicks to follow the link to
re-authenticate, then the database tables are locked.  This is very
duplicatable; it happens every single time.
•   Locks are for the entire table, and prevent any query action whatsoever
•   Problem has been on WebSphere 5.1.1.4 and WebSphere 5.1.1.6 on Windows.
•   Problem occurs with both MS JDBC drivers and WebSphere embedded drivers
•   Problem only occurs using JNDI.
•   Using JDBC with iBatis without JNDI does not exhibit any problems.
•   Problem will only occur if read of pubs database occurs
•   “Kill spid” command from SQL Server will terminate the connection and 
free all
users.  Otherwise, only stopping the entire server will kill the connection.
•   In trace log, IBM notes the following:  WebAppTransac E WTRN0043I:
LocalTransaction rolled-back due to setRollbackOnlyIBM has a tech note at
http://www-1.ibm.com/support/docview.wss?uid=swg21141640  which they contend
will fix the problem.  Unfortunately, it will also cause an automatic commit of
a transaction, if the developer was careless and an exception occurs.
•   No other exceptions or anomalous events occur

Questions
•   Under what circumstances will iBatis not ‘close’ database connections, 
i.e.,
return them to the pool?
•   Am I missing something that I need to do in iBatis that wasn’t required 
when
not using JNDI?
•   How do I set up logging for iBatis under WebSphere?  Can this be done 
as part
of the trace file so that it is all packaged together?

Thanks in advance for anyone who has the patience and time to look at this.  I
realize that this is rather lengthy, but I also realize that it may not be
nearly enough information to determine what is actually going on.

Thanks!
Rich



Re: confused about storing image data in my database

2005-11-07 Thread Jeff Butler
Ah...sorry.
 
This is sometimes hard to work through.  The problem is that bytea doesn't map easily to a JDBC type - hence the posgresql documentation telling you exactly what JDBC method to call.  If bytea means that you should call getBytes(), then I think you should use a byte[] in your bean, but NOT specify type of BLOB in the result map.  This will cause iBATIS to use the ByteArrayTypeHandler, which calls getBytes().

 
You can see how iBATIS decides what to do by looking at the class com.ibatis.sqlmap.engine.type.TypeHandlerFactory.  If there is a property of type byte[], and JDBC type is not BLOB or LONGVARBINARY, then iBATIS will use the ByteArrayTypeHandler - which should do what you want.

 
I hope I understand it this time :)
 
Jeff Butler 
On 11/7/05, Alan Chandler <[EMAIL PROTECTED]> wrote:
On Monday 07 Nov 2005 20:56, Jeff Butler wrote:> For BLOBs, the property in your bean should be of type byte[]. In the
> result map you may, or may not, need to specify jdbcType="BLOB" - it's> dependant on the driver (e.g. with DB2 it does not matter).>  I'm not familiar with OID - the byte[] and BLOB might work. If not, then
> try a property of type Object and cast it yourself to the proper type.>  All else fails, use a custom type handler. But I think the byte[] and BLOB> combination works in most cases.I think you misunderstand me.  I don't want to use the BLOB type.  The
question I am asking is how does the "bytea" type in Postgres map onto jdbctypes, and further, whatever that type is (and I think it isn't BLOB) howdoes that map on to a byte array in ibatis
--Alan Chandlerhttp://www.chandlerfamily.org.ukOpen Source. It's the difference between trust and antitrust.


RE: confused about storing image data in my database

2005-11-07 Thread Niels Beekman
I checked the postgres driver (I did not find a useful map on the
website), the methods getBytes() and setBytes() are ported directly to
the native bytea-datatype.

I think it works out-of-the-box :)

Niels

-Original Message-
From: Alan Chandler [mailto:[EMAIL PROTECTED] 
Sent: maandag 7 november 2005 23:28
To: user-java@ibatis.apache.org
Subject: Re: confused about storing image data in my database

On Monday 07 Nov 2005 20:56, Jeff Butler wrote:
> For BLOBs, the property in your bean should be of type byte[]. In the
> result map you may, or may not, need to specify jdbcType="BLOB" - it's
> dependant on the driver (e.g. with DB2 it does not matter).
>  I'm not familiar with OID - the byte[] and BLOB might work. If not,
then
> try a property of type Object and cast it yourself to the proper type.
>  All else fails, use a custom type handler. But I think the byte[] and
BLOB
> combination works in most cases.

I think you misunderstand me.  I don't want to use the BLOB type.  The 
question I am asking is how does the "bytea" type in Postgres map onto
jdbc 
types, and further, whatever that type is (and I think it isn't BLOB)
how 
does that map on to a byte array in ibatis


-- 
Alan Chandler
http://www.chandlerfamily.org.uk
Open Source. It's the difference between trust and antitrust.


Re: confused about storing image data in my database

2005-11-07 Thread Alan Chandler
On Monday 07 Nov 2005 20:56, Jeff Butler wrote:
> For BLOBs, the property in your bean should be of type byte[]. In the
> result map you may, or may not, need to specify jdbcType="BLOB" - it's
> dependant on the driver (e.g. with DB2 it does not matter).
>  I'm not familiar with OID - the byte[] and BLOB might work. If not, then
> try a property of type Object and cast it yourself to the proper type.
>  All else fails, use a custom type handler. But I think the byte[] and BLOB
> combination works in most cases.

I think you misunderstand me.  I don't want to use the BLOB type.  The 
question I am asking is how does the "bytea" type in Postgres map onto jdbc 
types, and further, whatever that type is (and I think it isn't BLOB) how 
does that map on to a byte array in ibatis


-- 
Alan Chandler
http://www.chandlerfamily.org.uk
Open Source. It's the difference between trust and antitrust.


Re: confused about storing image data in my database

2005-11-07 Thread Jeff Butler
For BLOBs, the property in your bean should be of type byte[].  In the result map you may, or may not, need to specify jdbcType="BLOB" - it's dependant on the driver (e.g. with DB2 it does not matter).

 
I'm not familiar with OID - the byte[] and BLOB might work.  If not, then try a property of type Object and cast it yourself to the proper type.
 
All else fails, use a custom type handler.  But I think the byte[] and BLOB combination works in most cases.
 
Jeff Butler
 
On 11/7/05, Alan Chandler <[EMAIL PROTECTED]> wrote:
Having made the first release of my family tree application its time to lookto the future.Once of the things that has been suggested to me is to store pictures of the
people and their marriages in the database.I am using Postgres which seems to have more than one method of binarystorage.  For very large binary objects (the documentation implies things inthe order of 1GB or more) then a separate large binary object is available
refered to via a datatype called OID in the table which logically holds it.As far as I can see from the jdbc documentation this is mapped to thejdbctype BLOB.But it also has a type of bytea which seems to map through to the java type of
byte[].  These seems much more appropriate for storing jpeg images (which iswhat I plan).In the ibatis wiki I noticed something that says you can get at binary data bymaking a result map with the result having an entry with the jdbctype="BLOB"
in it.The only write up I could find about jdbc types does not really talk about thetype as expressed in the ibatis xml - but it does say that there is agetBytes jdbc api (which is what bytea is mapped to).
Can I just have a property in my java object which has a byte array (with thegetter and setter methods)  and use result maps to declare a property forthis which maps on to the column in the database which is of type bytea.  Do
I need to do anything else?  Specifically do I need to use the jdbctypeattribute, and if I do what do I use for it?--Alan Chandlerhttp://www.chandlerfamily.org.uk
Open Source. It's the difference between trust and antitrust.


confused about storing image data in my database

2005-11-07 Thread Alan Chandler
Having made the first release of my family tree application its time to look 
to the future.

Once of the things that has been suggested to me is to store pictures of the 
people and their marriages in the database.

I am using Postgres which seems to have more than one method of binary 
storage.  For very large binary objects (the documentation implies things in 
the order of 1GB or more) then a separate large binary object is available 
refered to via a datatype called OID in the table which logically holds it.  
As far as I can see from the jdbc documentation this is mapped to the 
jdbctype BLOB.

But it also has a type of bytea which seems to map through to the java type of 
byte[].  These seems much more appropriate for storing jpeg images (which is 
what I plan).

In the ibatis wiki I noticed something that says you can get at binary data by 
making a result map with the result having an entry with the jdbctype="BLOB" 
in it.

The only write up I could find about jdbc types does not really talk about the 
type as expressed in the ibatis xml - but it does say that there is a 
getBytes jdbc api (which is what bytea is mapped to).

Can I just have a property in my java object which has a byte array (with the 
getter and setter methods)  and use result maps to declare a property for 
this which maps on to the column in the database which is of type bytea.  Do 
I need to do anything else?  Specifically do I need to use the jdbctype 
attribute, and if I do what do I use for it?

-- 
Alan Chandler
http://www.chandlerfamily.org.uk
Open Source. It's the difference between trust and antitrust.


Re: iBatis and ORM's

2005-11-07 Thread Clinton Begin

>> If we are going to have support for disconnected rowsets in the future
>> What would be the reasons why you might introduce such a concept in iBatis?

I don't know.  Personally I see no need.  But I am just one person of thousands who use this framework.

It will need to be discussed, a case will need to be made for
supporting them, and we'll need to ensure that doing so doesn't
threaten the scope of iBATIS or the existing feature set.  

Cheers,
Clinton
On 11/7/05, Abdullah Kauchali <[EMAIL PROTECTED]> wrote:
Clinton Begin wrote:>> >> I am simply asking for clarification.>> And now you have it.That iBatis is an ORM tool that lacks important ORM features?  :)  (Justjoking!)
Clinton,Firstly, please accept my apologies for upsetting you.   That was nevermy intention.  I see you are ona massive defensive mode here, so I will give up here.However, can you answer one last question for my sake on this topic -
I'd really appreciate it:If we are going to have support for disconnected rowsets in the future(for reasons other thanwhat I cite :-) ),  can you tell me on what basis they will beintroduced?  What would be the reasons
why you might introduce such a concept in iBatis?Kind regards,Abdullah


Property lookup at wrong level (Nested resultMap, groupBy)

2005-11-07 Thread Marnix Bindels

Dear all,

I keep getting the iBatis error There is no READABLE property named 
'values' in class 'nl.chess.it.arvato.pathe.A'. Did I misunderstand the 
entire groupBy concept or what?


Here's my setup:
MySql 4.1.7-nt, iBatis 2.1.5, Java 1.4

I am trying to get 3 levels of lists working: class A has a list of 
class B objects, and each B object has a list of Integers.

A single query gets the following from the database (a_id,b_id, value):

1, 1, 800
1, 1, 801
1, 1, 803
1, 2, 5
1, 2, 25
1, 2, 525

which I try to map using the following resultMaps:


   
   
   
  
   groupBy="ID" >

   
   
   
  
   groupBy="ID" >

   
   
   

on to a Single A object (ID=1) with a list of 2 B Objects ([B(ID=1, List 
[800,801,803]),B(ID=2, List[5,25,525])]


How do I correctly convince iBatis to look for the values property in 
class B instead of class A?


If any of you brave listeners want to join in :

   
   create table T_A
   (
   ID int not null,
   primary key (ID)
   )
   
   
   create table T_B
   (
   ID int not null,
   A_ID int not null,
   mylist int,
   primary key (ID)
   )
   
   
   create table woop
   (
   listid int not null,
   value int not null,
   )
   
  
   resultMap="Contract.AResult">

   select t_a.id a_id, t_b.id as b_id, value
   from
t_b join t_a on (t_a.id = t_b.a_id)
join woop on (t_b.mylist = woop.listid)   


   
   where
   t_a.id = #contractID#
   
   
   

Thanks,
 Marnix

--
CHESS-IT
Nieuwe Gracht 13
postbus 5021
2000 CA  Haarlem

+31 (0) 23 5149 135

[EMAIL PROTECTED]
www.chess.nl



Re: iBatis and ORM's

2005-11-07 Thread Abdullah Kauchali

Clinton Begin wrote:



>> I am simply asking for clarification. 

And now you have it. 


That iBatis is an ORM tool that lacks important ORM features?  :)  (Just 
joking!)


Clinton,

Firstly, please accept my apologies for upsetting you.   That was never 
my intention.  I see you are on
a massive defensive mode here, so I will give up here. 

However, can you answer one last question for my sake on this topic - 
I'd really appreciate it:


If we are going to have support for disconnected rowsets in the future 
(for reasons other than
what I cite :-) ),  can you tell me on what basis they will be 
introduced?  What would be the reasons

why you might introduce such a concept in iBatis?

Kind regards,

Abdullah


Re: [VOTE] Discontinue Support for: iBATIS Java 1.x, JDK 1.3 and DTDs at ibatis.com

2005-11-07 Thread netsql

Of course.. most of us point DTD in WEB-INF/lib or similar for many reasons.

.V




That would be a very good idea, yes.  



http://ibatis.apache.org/dtd/sql-map-config-2.dtd";>


a question: will this change affect my web applications using ibatis
(version 2.1.5)?



--
thx,
.V

Your Roomity Broadband Community 

cell: 917 825 3035 in DFW
email: netsql at roomity.com



Re: iBatis with Derby

2005-11-07 Thread Clinton Begin

Have you specified the jdbcType attribute for all nullable
fields?  If not, try that.  It's a requirement imposed by the
JDBC API (which some drivers, like MySQL, do fine without).

Cheers,
Clinton
On 11/7/05, Brad Balmer <[EMAIL PROTECTED]> wrote:
Sorry if I should be posting this to derby's list but I was hoping that
someone here may have also run into this.  My web application was
running on on MySQL with no issues.  I am porting it over to now
run on Derby and am running into some issues inserting NULL values into
simple VARCHAR fields.

I'm running iBatis 2.1.6 and when I try an update statement to my table I am getting the following SQL Exception:
An attempt was made to get a data value of type 'VARCHAR' from a data value of type '0'.

The fields I am updating allows NULL values and is declared simply as a VARCHAR(20).

The version of Derby I'm using is 10.1.1

The reason that I'm asking on this list is since I don't have control
of the underlying set functions for setting my
PreparedStatement/Statement values maybe there was something I needed
to tweak to get iBatis running with Derby.

Thanks for any help.




Re: [VOTE] Discontinue Support for: iBATIS Java 1.x, JDK 1.3 and DTDs at ibatis.com

2005-11-07 Thread Clinton Begin

That would be a very good idea, yes.  You can test your own
application in your environment to see if it's accessing the network
for the DTDs (i.e. if you're using an XML parser that doesn't
understand EntityResolvers).  It shouldn't actually stop any
applications from running, but it may stop them from starting, as DTDs
are only loaded once at application startup time (assuming you're not
doing something out of the ordinary, like reloading SQL Map files
during runtime).

Cheers,
ClintonOn 11/7/05, Emiliano Armellin <[EMAIL PROTECTED]> wrote:



  


Clinton Begin ha scritto:

Let's lose the capitalization in the domain of the public ID
  

    PUBLIC "-//ibatis.apache.org//DTD SQL Map Config 2.0//EN"
    "http://ibatis.apache.org/dtd/sql-map-config-2.dtd">
  

a question: will this change affect my web applications using ibatis
(version 2.1.5)?
have I got to change all dtd declarations in my sql-map file and deploy
them before 30 november?

thanks

-- 
Emiliano Armellin

  
W_
www.ateikon.com
  
@_
[EMAIL PROTECTED]
  
T_
+39 0422 452101





?








Re: iBatis and ORM's

2005-11-07 Thread Clinton Begin
Vic, 

For what it's worth, it's the same argument that we'd use against Maps
as the domain model, which we've been through (a thread almost as long
and tedious as this one).  ;-)

Obviously there are some significant design philosophy differences at work here.   And that's okay.  iBATIS is our
philosophy, and is one worth protecting.  My monthly bandwidth
overcharge bills tell me that at least a few people agree with me.

Anyone with a different philosophy is welcome to comment and request
features, but belaboring points such as this, and implicitly or
explicitly "concluding" things of their own as Abdullah has done,
inevitably becomes rude and a waste of time.  It serves only to
annoy and distract the rest of the list.

We've noted the feature request.  But further design philosophy wars are out of scope for this list.  

My apologies to the rest of the list for filling your inboxes with this.

Best regards,

Clinton
On 11/7/05, netsql <[EMAIL PROTECTED]> wrote:
Clinton, I agree, they don't feel right. Can you help me verbalize yourbellow statment.Why is dataset or rowset a horrible design choice?.VClinton Begin wrote:>> Datasets, rowsets, strongly typed or not are generally a horrible design
> choice and shouldn't be used in any sort of system that requires a> maintainable object model that can exist with or without a database.>>--thx,.VYour Roomity Broadband Community <
http://roomity.com/demo.jsp>cell: 917 825 3035 in DFWemail: netsql at roomity.com


Re: iBatis and ORM's

2005-11-07 Thread Clinton Begin
>> I am simply asking for clarification.  And now you have it.  

Enjoy.
Clinton
On 11/7/05, Abdullah Kauchali <[EMAIL PROTECTED]> wrote:
Clinton Begin wrote:> >> The fact that it currently translates the resultsets into an object> model> >> As a matter of fact, it could be argued that /that/ part of iBatis> is its /weakness/.
>> That part?  That's not a part...that's ALL iBATIS does. If you've> misunderstood that, then I'm sorry for our lack of clarity.As far as I know (please correct my ignorance), iBatis does the following:
1.  It does a good job of hiding tedious JDBC stuff (transaction stuffincluded) through a "best practices"approach;2.  It does a fantastic job of dynamically constructing SQL/spstatements (complete with iterations,
string replacements etc);3.  It does a good of "organising" your SQL statements /outside/ yourapplication;4.  It does a good job of mapping query results to an object model;  :)5.  It /also/ returns simple collection objects (very much like datasets
but without the built-in_expression_ support, metadata or navigation support you'd normallyassociate with datasets.);6.  It does a brilliant job of caching /results/ from SQL statements orstored procedures;
(There are more I'm sure.)Now, depending on the circumstances, a user of iBatis may or may notfind any one or more of the abovefeatures useful.  In some cases, some of the features are totallyuseless.  In /my/ situation, feature number 4. is
a total waste of time!  Why?  Because we're not interested in the ORMfeatures of iBatis.  Instead, we areinterested in the "collection" model of iBatis - a functionalitycurrently afforded by iBatis when we avoid
doing the "rich object model" stuff (feature 4.).> >> Look at some of the comments Gavin is making about /lack/ of> >> ORM functionality in iBatis because of this:>> Gavin's right.  We lack a lot of ORM features.  Because we're not an ORM.
That, IMHO, is a wrong reason to say "we are not an ORM".  A correctconclusion from that is that "weare a *bad* ORM".It just gives more ammo to the Hibernate folks.Needlessly.
> No, you are the only person suggesting that thus far.I am simply asking for clarification.  I began this thread by saying"iBatis is /not/ an ORM."  I wanted tounderstand why you say that too.  And if you believe it, give some good
reasons, because I need to usethem for iBatis' sake in our project.> All I've said is:  call it that if you want.I certainly don't want to call iBatis an ORM because I believe it offersa paradigmatically alternative
solution strategy to ORMs.  I believe it is not an ORM - not because itlacks key features of an ORM - butbecause it offers a "dataset" based solution too.> I can't seem to convince you otherwise.
I doubt you will convince anyone by saying that iBatis is not an ORMbecause it has some ORM stuff butit lacks some key features of an ORM.  That simply is not going to befruitful.  It's like saying a half-baked
cake is not a cake.  It's simply a /bad/ cake.> It seems that I could only do so by supporting disconnected rowsets.iBatis currently supports disconnected rowsets.  Yes.  But not thestandard ones.  Yes, I would certainly  be
happy if I could have iBatis return a rowset instead of me constructingone by the row handler logic.  I wouldreally appreciate the effort towards that.  Without a doubt.  (I wonderhow many others would too?)
> We may indeed do that in the future...but not for the reasons you're> suggesting.  For a good description of the differences between ORMs> (Metadata Mapper) and iBATIS (Data Mapper) and Table Data Gateways
> (DataSets), see Martin Fowler's Patterns of Enterprise Application> Architecture.I will thanks.> I see you've entered the feature request in JIRA.  It is likely it> will make it into some future release.
Yup.  :)   I am really hoping you guys would find some time to look intoit.  Really.  :)BTW, I mean offense or disrespect for the valuable time and effort allyou guys put into iBatis.  I love iBatis.
I would like to continue using it and trust that my comments here areonly received as a way to improve onit!I certainly hope so.


Re: iBatis and ORM's

2005-11-07 Thread netsql
Clinton, I agree, they don't feel right. Can you help me verbalize your 
bellow statment.

Why is dataset or rowset a horrible design choice?

.V


Clinton Begin wrote:



Datasets, rowsets, strongly typed or not are generally a horrible design 
choice and shouldn't be used in any sort of system that requires a  
maintainable object model that can exist with or without a database.





--
thx,
.V

Your Roomity Broadband Community 

cell: 917 825 3035 in DFW
email: netsql at roomity.com



iBatis with Derby

2005-11-07 Thread Brad Balmer
Sorry if I should be posting this to derby's list but I was hoping that
someone here may have also run into this.  My web application was
running on on MySQL with no issues.  I am porting it over to now
run on Derby and am running into some issues inserting NULL values into
simple VARCHAR fields.

I'm running iBatis 2.1.6 and when I try an update statement to my table I am getting the following SQL Exception:
An attempt was made to get a data value of type 'VARCHAR' from a data value of type '0'.

The fields I am updating allows NULL values and is declared simply as a VARCHAR(20).

The version of Derby I'm using is 10.1.1

The reason that I'm asking on this list is since I don't have control
of the underlying set functions for setting my
PreparedStatement/Statement values maybe there was something I needed
to tweak to get iBatis running with Derby.

Thanks for any help.



Re: [VOTE] Discontinue Support for: iBATIS Java 1.x, JDK 1.3 and DTDs at ibatis.com

2005-11-07 Thread Emiliano Armellin




Clinton Begin ha scritto:

Let's lose the capitalization in the domain of the public ID
  

    PUBLIC "-//ibatis.apache.org//DTD SQL Map Config 2.0//EN"
    "http://ibatis.apache.org/dtd/sql-map-config-2.dtd">
  

a question: will this change affect my web applications using ibatis
(version 2.1.5)?
have I got to change all dtd declarations in my sql-map file and deploy
them before 30 november?

thanks

-- 
Emiliano Armellin

  
W_
www.ateikon.com
  
@_
[EMAIL PROTECTED]
  
T_
+39 0422 452101



?






Re: iBatis and ORM's

2005-11-07 Thread Abdullah Kauchali

Abdullah Kauchali wrote:

BTW, I mean offense or disrespect 



LOL.   I mean *NO* offense or disrespect ...

Sheesh, as if the discussion isn't sensitive already!  :-D


Re: iBatis and ORM's

2005-11-07 Thread Abdullah Kauchali

Clinton Begin wrote:

>> The fact that it currently translates the resultsets into an object 
model
>> As a matter of fact, it could be argued that /that/ part of iBatis 
is its /weakness/.


That part?  That's not a part...that's ALL iBATIS does. If you've 
misunderstood that, then I'm sorry for our lack of clarity.



As far as I know (please correct my ignorance), iBatis does the following:

1.  It does a good job of hiding tedious JDBC stuff (transaction stuff 
included) through a "best practices"

approach;

2.  It does a fantastic job of dynamically constructing SQL/sp 
statements (complete with iterations,

string replacements etc);

3.  It does a good of "organising" your SQL statements /outside/ your 
application;


4.  It does a good job of mapping query results to an object model;  :)

5.  It /also/ returns simple collection objects (very much like datasets 
but without the built-in
expression support, metadata or navigation support you'd normally 
associate with datasets.);


6.  It does a brilliant job of caching /results/ from SQL statements or 
stored procedures;


(There are more I'm sure.)

Now, depending on the circumstances, a user of iBatis may or may not 
find any one or more of the above
features useful.  In some cases, some of the features are totally 
useless.  In /my/ situation, feature number 4. is
a total waste of time!  Why?  Because we're not interested in the ORM 
features of iBatis.  Instead, we are
interested in the "collection" model of iBatis - a functionality 
currently afforded by iBatis when we avoid

doing the "rich object model" stuff (feature 4.).


>> Look at some of the comments Gavin is making about /lack/ of
>> ORM functionality in iBatis because of this:

Gavin's right.  We lack a lot of ORM features.  Because we're not an ORM.



That, IMHO, is a wrong reason to say "we are not an ORM".  A correct 
conclusion from that is that "we
are a *bad* ORM".It just gives more ammo to the Hibernate folks.  
Needlessly.



No, you are the only person suggesting that thus far.  


I am simply asking for clarification.  I began this thread by saying 
"iBatis is /not/ an ORM."  I wanted to
understand why you say that too.  And if you believe it, give some good 
reasons, because I need to use

them for iBatis' sake in our project.

All I've said is:  call it that if you want.  


I certainly don't want to call iBatis an ORM because I believe it offers 
a paradigmatically alternative
solution strategy to ORMs.  I believe it is not an ORM - not because it 
lacks key features of an ORM - but

because it offers a "dataset" based solution too.

I can't seem to convince you otherwise. 


I doubt you will convince anyone by saying that iBatis is not an ORM 
because it has some ORM stuff but
it lacks some key features of an ORM.  That simply is not going to be 
fruitful.  It's like saying a half-baked

cake is not a cake.  It's simply a /bad/ cake.

It seems that I could only do so by supporting disconnected rowsets.  


iBatis currently supports disconnected rowsets.  Yes.  But not the 
standard ones.  Yes, I would certainly  be
happy if I could have iBatis return a rowset instead of me constructing 
one by the row handler logic.  I would
really appreciate the effort towards that.  Without a doubt.  (I wonder 
how many others would too?)


We may indeed do that in the future...but not for the reasons you're 
suggesting.  For a good description of the differences between ORMs 
(Metadata Mapper) and iBATIS (Data Mapper) and Table Data Gateways 
(DataSets), see Martin Fowler's Patterns of Enterprise Application 
Architecture.


I will thanks.

I see you've entered the feature request in JIRA.  It is likely it 
will make it into some future release.


Yup.  :)   I am really hoping you guys would find some time to look into 
it.  Really.  :)


BTW, I mean offense or disrespect for the valuable time and effort all 
you guys put into iBatis.  I love iBatis.
I would like to continue using it and trust that my comments here are 
only received as a way to improve on

it!

I certainly hope so.