RE: Using a stored proc in selectKey?

2005-04-07 Thread Adriano Labate
Thank you for all your answers. 
A stored proc cannot be used in a select statement, unlike a function. In fact, 
I think the solution could be to create a function that wraps the call to the 
stored proc and then returns the id. that way I can then use a statement like :

  select fct_getnextid(category_id) as id from dual 

Adriano Labate

-Message d'origine-
De : Jason Hall [mailto:[EMAIL PROTECTED] 
Envoyé : mercredi, 6 avril 2005 19:26
À : ibatis-user-java@incubator.apache.org; Brandon Goodin
Objet : RE: Using a stored proc in selectKey?

Why don't you call your stored procedure through the select statement.

ex.

insert ...
selectKey KeyProperty=id ... 
select sp_get_next_id('CATEGORY_ID',???) as id from dual;
/selectKey
.
.
/insert

Jason Hall


-Original Message-
From: Brandon Goodin [mailto:[EMAIL PROTECTED]
Sent: Wednesday, April 06, 2005 12:47 PM
To: ibatis-user-java@incubator.apache.org
Subject: Re: Using a stored proc in selectKey?


AFAIK we don't support CallableStatement in the selectKey. If you
would like it to be, go ahead and place an enhancement  request in
JIRA. But, i would think that if you are doing something like you are
describing, you would simply make your inserts all store procedures
and handle the increment internally. You can then set an OUT parameter
for the ID to pass back into your object.

BTW, Isn't a stored proc a proprietary approach?

Brandon

On Apr 6, 2005 10:35 AM, Adriano Labate [EMAIL PROTECTED] wrote:
 Hi,
 
 Is it possible to call an Oracle stored procedure in order to get the id
 in the selectKey tag?
 
 My stored proc is defined as :
 
 CREATE OR REPLACE PROCEDURE SP_GET_NEXT_ID(nIDTYPE IN NUMBER, nNEXTID
 OUT NUMBER) as
 nIDTYPEBUF NUMBER;
 nTheNewId NUMBER;
 ...
 
 Where
 
 IN : The idtype to be generated
 1,PERSONID
 2,PERSONTYPEID
 3,CATEGORYID
 ...
 OUT : The next id for the type input (nIDTYPE)
   -1 (Error in the IDTYPE input)
 
 I know I can use an Oracle sequence, but the reason we are using a
 stored proc is because we don't want the DB client has to deal with a
 proprietary sequence.
 
 So, is it possible to call that stored proc in the selectKey section?
 
 Thanks,
 Adriano



ibatis says no results but query does return results

2005-04-07 Thread Dan Tenenbaum
I am running  a query from ibatis and I get this error:

java.lang.reflect.UndeclaredThrowableException
at $Proxy9.getVisibleSelectedIds(Unknown Source)
at 
(...)
... 18 more
Caused by: com.ibatis.dao.client.DaoException: Error executing query for
list.  Cause: com.ibatis.common.jdbc.exception.NestedSQLException:   
--- The error occurred while applying a parameter map.  
--- Check the getVisibleSelectedTopicIds-InlineParameterMap.  
--- Check the results (failed to retrieve results).  
--- Cause: java.lang.NullPointerException
Caused by: java.lang.NullPointerException
Caused by: com.ibatis.common.jdbc.exception.NestedSQLException:   
--- The error occurred while applying a parameter map.  
--- Check the getVisibleSelectedTopicIds-InlineParameterMap.  
--- Check the results (failed to retrieve results).  
--- Cause: java.lang.NullPointerException
Caused by: java.lang.NullPointerException
(...)

However, the logger output of the query in question is as follows:

11:41:56,523 DEBUG PreparedStatement:28 - {pstm-100138}
PreparedStatement:   select id from topics where id in
(? ,   ? )and id not in (
select topic_key from topic_eligibility where is_visible = false
and sponsor_key in
(   ?  ,?  ) ) order
by patient_title   
11:41:56,524 DEBUG PreparedStatement:29 - {pstm-100138} Parameters:
[125, 126, 1, 2]
11:41:56,525 DEBUG PreparedStatement:30 - {pstm-100138} Types:
[java.lang.Integer, java.lang.Integer, java.lang.Integer,
java.lang.Integer]
11:41:56,530 DEBUG ResultSet:24 - {rset-100139} ResultSet

(The funny spacing in the SQL query is due to it being in an xml file,
and some of it comes from the iterate tag.)
Anyway, if I take that query (from the logger output) and paste it into
a database client, and replace the question marks with the parameters
output by the logger above, the query runs and returns data, just as I
expect it to. (The database is in exactly the same state). So why is it
that I can run this query manually, but when run from IBATIS it doesn't
return data?

I have actually run into a couple of cases where iBATIS threw an error
that turned out to be about something other than what it claimed. But in
this case, it really does seem to be this query, because I have isolated
it from everything else to verify that.

Thanks



About MySQL Driver Properties in transactionManager

2005-04-07 Thread Akihiro Kubota








transactionManager type=JDBC

  dataSource
type=SIMPLE  

  property
name=JDBC.Driver value=com.mysql.jdbc.Driver /

 property name=JDBC.ConnectionURL
value=jdbc:mysql://localhost:3306/exam?zeroDateTimeBehavior=convertToNull
/

 property
name=JDBC.Username value=${username} /

 property
name=JDBC.Password value=${password} /

  property
name=JDBC.DefaultAutoCommit value=true/

  property
name=Pool.MaximumActiveConnections value=15 /

 property
name=Pool.MaximumIdleConnections value=15 /

 property
name=Pool.MaximumWait value=1000 /

 /dataSource 

 /transactionManager



As you can see the
BOLD part of the mysqlconfig.xml file.



Is there a way for
the transactionManager to include properties specific to the 

database?



For example like :



 ...

  property
name=JDBC.Driver value=com.mysql.jdbc.Driver /

 property name=JDBC.ConnectionURL
value=jdbc:mysql://localhost:3306/exam?
/

  property name=JDBC.Driver.zeroDateTimeBehavior value=convertToNull/

 property
name=JDBC.Username value=${username} /

 property
name=JDBC.Password value=${password} /



I
will really appreciate for this kind of change.



Thanks!















Support for oracle cursors as resultsets

2005-04-07 Thread Grassi Fabio
Title: Messaggio



The support for oracle ref 
cursors both as stored-function results and as out stored-procedure parameters 
is critical for me as well. I have a not-so-small code base (150-200 stored 
procedures) I currently access to through Oracle JPublisher. I would like to 
dismiss JPublisher in favour of a more general pourpose data mapping framework 
like iBatis.

The enhacements I would need 
have somehow been anticipated in:
http://issues.apache.org/jira/browse/IBATIS-53?page=comments#action_57838and are:

1) Support for returning Oracle 
ref cursors as function results as well as out procedure 
parameters.
2) Support for declarative 
mapping of ref cursor fields to bean properties (for instance byadoption 
of resultMap attribute for parameter element).

I am willing to 
contributeto the coding and testing effort. Please let me know how to 
proceed.

Best regards, 
Fabio.



ORIGINAL MESSAGE 
BELOW
*

Graham CruickshanksFri, 01 Apr 
2005 05:54:36 -0800
Hi,First of all I would like to say good 
work on putting together the excellent Ibatis. I would like to use Ibatis in new 
project Im working on, but its for a commercial entity and the oracle cursors 
to resultset is a must. I would like to help extend Ibatis to add better support 
of the Oracle dialect. Not for the companies sake, but for the sanity of not 
writing another straight JDBC to Stored procedure class 
again!!There are some patches kicking about for 
SqlExecutor.java on JIRA that are pretty patchy, is there any thoughts on 
adding a dialect factory to this class with a default dialect for each function 
and subclass overrides?Please let me known if any help would be useful.CheersGraham CruickshanksAi sensi del D.Lgs. 196/2003 si precisa che le informazioni contenute in questo messaggio sono riservate ed a uso esclusivo del destinatario. Qualora il messaggio in parola Le fosse pervenuto per errore, La invitiamo ad eliminarlo senza copiarlo e a non inoltrarlo a terzi, dandocene gentilmente comunicazione. Grazie.Pursuant to Legislative Decree No. 196/2003, you are hereby informed that this message contains confidential information intended only for the use of the addressee. If you are not the addressee, and have received this message by mistake, please delete it and immediately notify us. You may not copy or disseminate this message to anyone. Thank you.


Re: How do I use the dollar sign notation (i.e. $xyz$) to send a string to the database that has a pound sign on either side of it?

2005-04-07 Thread Brice Ruth
Note - the $xyz$ notation does not create a '?' for a prepared statement ... it's value (as indicated by Brandon) is placed into the SQL string before the prepared statement is generated.
On Apr 6, 2005 4:25 PM, Ron Grabowski [EMAIL PROTECTED] wrote:
How do I use the dollar sign notation (i.e. $xyz$) to send a string tothe database that has a pound sign on either side of it?According to this post:http://tinyurl.com/44je6http://www.mail-archive.com/ibatis-user-java@incubator.apache.org/msg01358.htmlI should use a double pound to send the literal pound. Given this sqlstatement:select parameterClass=map resultClass=stringSELECT Name FROM Band WHERE Name = '12##34$BandName$56##78'/selectWhich of the two choices below should I see in my log files?A) SELECT Name FROM Band WHERE Name = '12?78'B) SELECT Name FROM Band WHERE Name = '12#34?56#78'Thanks,Ron-- Brice RuthSoftware Engineer, Madison WI

Re: ibatis technology need company references.

2005-04-07 Thread Brice Ruth
Vic, can you use an email client that actually puts Vic as your name?! Would you like a Gmail account?!

Love your contributions, but always frustrated that I can't tell who's posting until I see .V ... :)
On Apr 6, 2005 9:26 PM, NetSQL [EMAIL PROTECTED] wrote:
1up.com is using iBatis 2 and has 10 million members and 10,000concurent users.My new project is larger..VVictor Stepanov wrote: Brandon Goodin wrote: I can vouch that we use iBatis internally at Plum Creek Timber Company, Inc. But, i can't give you links or anything. Brandon On Apr 6, 2005 9:55 AM, Victor Stepanov [EMAIL PROTECTED] wrote: Hi All. I need to provide references about ibatis and sqlmaps that this product is stable can anybody give some references or where I can found it. Thanks. I can describe sitution we write one tender where describe that we use IBatis but we've got claim that IBatis in Apche Incubator and not stable for goverment sector development . For me will be good get some links or may be some documents -- Brice RuthSoftware Engineer, Madison WI

class cast exception

2005-04-07 Thread Baldur Norddahl
Hi,
In some of our projects we are haunted by a strange class cast 
exception. I suspect it is a class loader issue. Just after restarting 
the application server everything works fine, and it may continue to 
work fine for hours or days. Until suddenly it stops working with this 
kind of errors:

2005-04-07 14:39:15,564 [TP-Processor112] ERROR 
com.ibatis.db.sqlmap.MappedStatement  - Error executing 
'getGameIdByContentId' in 'com/xentive/shopdb/webshop.xml'. Check the 
Parameter Map (or inline parameters).  Check the 'value' property. 
Cause: java.lang.ClassCastException: java.lang.String
java.lang.ClassCastException: java.lang.String
   at 
com.ibatis.db.sqlmap.MappedStatement.runQueryForObject(Unknown Source)
   at 
com.ibatis.db.sqlmap.MappedStatement.executeQueryForObject(Unknown Source)
   at 
com.ibatis.db.sqlmap.MappedStatement.executeQueryForObject(Unknown Source)
   at com.ibatis.db.sqlmap.SqlMap.executeQueryForObject(Unknown Source)
   at com.xentive.shopdb.OrderHandler.doGet(OrderHandler.java:123)

The statement looks like this:
 mapped-statement name=getGameIdByContentId 
result-class=java.lang.String
   select game_id as value from webshop.game where id=#value#
 /mapped-statement

And the code that invokes it:
String gameId = 
SqlConfig.webshop.executeQueryForObject(getGameIdByContentId,contentid.toString()).toString();

Restarting the application server always fixes the problem for a while.
Usually we can fix the problem applications by converting everything 
to strings. That did not work in this case though.

We are using:
postgresql 7.4.3
tomcat 5.0.27
jdk 1.5.0
The datasource is a global shared pool:
  datasource 
factory-class=com.ibatis.db.sqlmap.datasource.JndiDataSourceFactory 
name=webshop default=true
 property name=DBFullJndiContext value=java:comp/env/jdbc/db/
  /datasource

I hope somebody got an idea for me how I can go about fixing this.
Thanks,
Baldur


Re: ibatis technology need company references.

2005-04-07 Thread NetSQL
I... sometimes say things I should not. So a company policy is to go by 
handles, in my case netsql.
I do wonder if that is ok?

.V
Brice Ruth wrote:
Vic, can you use an email client that actually puts Vic as your 
name?! Would you like a Gmail account?!
 
Love your contributions, but always frustrated that I can't tell who's 
posting until I see .V ... :)

 



R: class cast exception

2005-04-07 Thread Grassi Fabio
Where do you put you iBatis jar files? In common/lib, server/lib or WEB-INF/lib?> -Messaggio originale-> Da: Baldur Norddahl [mailto:[EMAIL PROTECTED] > Inviato: giovedì 7 aprile 2005 15:36> A: ibatis-user-java@incubator.apache.org> Oggetto: class cast exception> > > Hi,> > In some of our projects we are haunted by a strange class cast > exception. I suspect it is a class loader issue. Just after > restarting > the application server everything works fine, and it may continue to > work fine for hours or days. Until suddenly it stops working > with this > kind of errors:> > 2005-04-07 14:39:15,564 [TP-Processor112] ERROR > com.ibatis.db.sqlmap.MappedStatement  - Error executing > 'getGameIdByContentId' in 'com/xentive/shopdb/webshop.xml'. Check the > Parameter Map (or inline parameters).  Check the 'value' property. > Cause: java.lang.ClassCastException: java.lang.String> java.lang.ClassCastException: java.lang.String> at > com.ibatis.db.sqlmap.MappedStatement.runQueryForObject(Unknown Source)> at > com.ibatis.db.sqlmap.MappedStatement.executeQueryForObject(Unk> nown Source)> at > com.ibatis.db.sqlmap.MappedStatement.executeQueryForObject(Unk> nown Source)> at > com.ibatis.db.sqlmap.SqlMap.executeQueryForObject(Unknown Source)> at > com.xentive.shopdb.OrderHandler.doGet(OrderHandler.java:123)> > > The statement looks like this:> >   > result-class="java.lang.String">> select game_id as value from webshop.game where id=#value#>   > > And the code that invokes it:> > String gameId = > SqlConfig.webshop.executeQueryForObject("getGameIdByContentId"> ,contentid.toString()).toString();> > Restarting the application server always fixes the problem > for a while.> > Usually we can "fix" the problem applications by converting > everything > to strings. That did not work in this case though.> > We are using:> > postgresql 7.4.3> tomcat 5.0.27> jdk 1.5.0> > The datasource is a global shared pool:> >> factory-class="com.ibatis.db.sqlmap.datasource.JndiDataSourceFactory" > name="webshop" default="true">>   > value="java:comp/env/jdbc/db"/>>> > I hope somebody got an idea for me how I can go about fixing this.> > Thanks,> > Baldur> > Ai sensi del D.Lgs. 196/2003 si precisa che le informazioni contenute in questo messaggio sono riservate ed a uso esclusivo del destinatario. Qualora il messaggio in parola Le fosse pervenuto per errore, La invitiamo ad eliminarlo senza copiarlo e a non inoltrarlo a terzi, dandocene gentilmente comunicazione. Grazie.Pursuant to Legislative Decree No. 196/2003, you are hereby informed that this message contains confidential information intended only for the use of the addressee. If you are not the addressee, and have received this message by mistake, please delete it and immediately notify us. You may not copy or disseminate this message to anyone. Thank you.

Re: R: class cast exception

2005-04-07 Thread Baldur Norddahl




Grassi Fabio wrote:

  
  
Where do you put you iBatis jar files? In common/lib, server/lib or
WEB-INF/lib?
  


WEB-INF/lib in the .war file - so iBatis is not shared. Some of our
applications run with old iBatis and some with the new version.

Thanks,

Baldur

 -Messaggio originale-
 Da: Baldur Norddahl [mailto:[EMAIL PROTECTED]] 
 Inviato: gioved 7 aprile 2005 15:36
 A: ibatis-user-java@incubator.apache.org
 Oggetto: class cast exception
 
 
 Hi,
 
 In some of our projects we are haunted by a strange class cast 
 exception. I suspect it is a class loader issue. Just after 
 restarting 
 the application server everything works fine, and it may continue
to 
 work fine for hours or days. Until suddenly it stops working 
 with this 
 kind of errors:
 
 2005-04-07 14:39:15,564 [TP-Processor112] ERROR 
 com.ibatis.db.sqlmap.MappedStatement - Error executing 
 'getGameIdByContentId' in 'com/xentive/shopdb/webshop.xml'. Check
the 
 Parameter Map (or inline parameters). Check the 'value' property. 
 Cause: java.lang.ClassCastException: java.lang.String
 java.lang.ClassCastException: java.lang.String
 at 
 com.ibatis.db.sqlmap.MappedStatement.runQueryForObject(Unknown
Source)
 at 
 com.ibatis.db.sqlmap.MappedStatement.executeQueryForObject(Unk
 nown Source)
 at 
 com.ibatis.db.sqlmap.MappedStatement.executeQueryForObject(Unk
 nown Source)
 at 
 com.ibatis.db.sqlmap.SqlMap.executeQueryForObject(Unknown Source)
 at 
 com.xentive.shopdb.OrderHandler.doGet(OrderHandler.java:123)
 
 
 The statement looks like this:
 
 
 result-class="java.lang.String"
 select game_id as value from webshop.game where id=#value#
 
 
 And the code that invokes it:
 
 String gameId = 
 SqlConfig.webshop.executeQueryForObject("getGameIdByContentId"
 ,contentid.toString()).toString();
 
 Restarting the application server always fixes the problem 
 for a while.
 
 Usually we can "fix" the problem applications by converting 
 everything 
 to strings. That did not work in this case though.
 
 We are using:
 
 postgresql 7.4.3
 tomcat 5.0.27
 jdk 1.5.0
 
 The datasource is a global shared pool:
 
 

factory-class="com.ibatis.db.sqlmap.datasource.JndiDataSourceFactory" 
 name="webshop" default="true"
 
 value="java:comp/env/jdbc/db"/
 
 
 I hope somebody got an idea for me how I can go about fixing this.
 
 Thanks,
 
 Baldur
 
 
Ai sensi del D.Lgs. 196/2003 si precisa che le informazioni contenute
in questo messaggio sono riservate ed a uso esclusivo del destinatario.
Qualora il messaggio in parola Le fosse pervenuto per errore, La
invitiamo ad eliminarlo senza copiarlo e a non inoltrarlo a terzi,
dandocene gentilmente comunicazione. Grazie.
  
Pursuant to Legislative Decree No. 196/2003, you are hereby informed
that this message contains confidential information intended only for
the use of the addressee. If you are not the addressee, and have
received this message by mistake, please delete it and immediately
notify us. You may not copy or disseminate this message to anyone.
Thank you.





Re: How do I use the dollar sign notation (i.e. $xyz$) to send a string to the database that has a pound sign on either side of it?

2005-04-07 Thread Ron Grabowski
Correct. The main point I was trying to make was that choice B from my
choices below is the correct way to parse things. 34 and 56 should
remain in the sql being sent to the database. 

This is related to an issue with IBatisNet:

 http://issues.apache.org/jira/browse/IBATISNET-29

I wanted to make sure my explaination and example made sense to other
people besides myself. The issue was marked as Won't Fix on Jira. I
posted more supporting comments on the issue but I wasn't sure those
made the issue any clearer (i.e. its still marked at Won't Fix).

For future reference, is there a better way to go about discussing
issues with IBatis? If I have concerns with an IBatis issue posted in
Jira, it gets marked as Won't Fix, and I'm not able to fix it myself,
is it appropriate to have open discussions on the mailing list(s)?

- Ron

--- Brice Ruth [EMAIL PROTECTED] wrote:
 Note - the $xyz$ notation does not create a '?' for a prepared
 statement ... 
 it's value (as indicated by Brandon) is placed into the SQL string
 before 
 the prepared statement is generated.
 
 On Apr 6, 2005 4:25 PM, Ron Grabowski [EMAIL PROTECTED] wrote:
 
  
  How do I use the dollar sign notation (i.e. $xyz$) to send a string
 to
  the database that has a pound sign on either side of it?
  
  According to this post:
  
  http://tinyurl.com/44je6
  
 

http://www.mail-archive.com/ibatis-user-java@incubator.apache.org/msg01358.html
  
  I should use a double pound to send the literal pound. Given this
 sql
  statement:
  
  select parameterClass=map resultClass=string
  SELECT Name FROM Band WHERE Name = '12##34$BandName$56##78'
  /select
  
  Which of the two choices below should I see in my log files?
  
  A) SELECT Name FROM Band WHERE Name = '12?78'
  B) SELECT Name FROM Band WHERE Name = '12#34?56#78'
  
  Thanks,
  Ron
  
 
 
 
 -- 
 Brice Ruth
 Software Engineer, Madison WI
 


Re: ibatis says no results but query does return results

2005-04-07 Thread Brandon Goodin
It would help if you posted the sqlmap, the sqlmap config, associated
property files and the full code that calls the sqlmap.

Brandon

On Apr 6, 2005 12:50 PM, Dan Tenenbaum [EMAIL PROTECTED] wrote:
 I am running  a query from ibatis and I get this error:
 
 java.lang.reflect.UndeclaredThrowableException
 at $Proxy9.getVisibleSelectedIds(Unknown Source)
 at
 (...)
 ... 18 more
 Caused by: com.ibatis.dao.client.DaoException: Error executing query for
 list.  Cause: com.ibatis.common.jdbc.exception.NestedSQLException:
 --- The error occurred while applying a parameter map.
 --- Check the getVisibleSelectedTopicIds-InlineParameterMap.
 --- Check the results (failed to retrieve results).
 --- Cause: java.lang.NullPointerException
 Caused by: java.lang.NullPointerException
 Caused by: com.ibatis.common.jdbc.exception.NestedSQLException:
 --- The error occurred while applying a parameter map.
 --- Check the getVisibleSelectedTopicIds-InlineParameterMap.
 --- Check the results (failed to retrieve results).
 --- Cause: java.lang.NullPointerException
 Caused by: java.lang.NullPointerException
 (...)
 
 However, the logger output of the query in question is as follows:
 
 11:41:56,523 DEBUG PreparedStatement:28 - {pstm-100138}
 PreparedStatement:   select id from topics where id in
 (? ,   ? )and id not in (
 select topic_key from topic_eligibility where is_visible = false
 and sponsor_key in
 (   ?  ,?  ) ) order
 by patient_title
 11:41:56,524 DEBUG PreparedStatement:29 - {pstm-100138} Parameters:
 [125, 126, 1, 2]
 11:41:56,525 DEBUG PreparedStatement:30 - {pstm-100138} Types:
 [java.lang.Integer, java.lang.Integer, java.lang.Integer,
 java.lang.Integer]
 11:41:56,530 DEBUG ResultSet:24 - {rset-100139} ResultSet
 
 (The funny spacing in the SQL query is due to it being in an xml file,
 and some of it comes from the iterate tag.)
 Anyway, if I take that query (from the logger output) and paste it into
 a database client, and replace the question marks with the parameters
 output by the logger above, the query runs and returns data, just as I
 expect it to. (The database is in exactly the same state). So why is it
 that I can run this query manually, but when run from IBATIS it doesn't
 return data?
 
 I have actually run into a couple of cases where iBATIS threw an error
 that turned out to be about something other than what it claimed. But in
 this case, it really does seem to be this query, because I have isolated
 it from everything else to verify that.
 
 Thanks
 



Re: ibatis says no results but query does return results

2005-04-07 Thread Larry Meadors
this somehow got resent, we solved this yesterday...missing resultmap/resultclass attribute in the select tagOn Apr 7, 2005 8:10 AM, Brandon Goodin [EMAIL PROTECTED] wrote:It would help if you posted the sqlmap, the sqlmap config, associatedproperty files and the full code that calls the sqlmap.BrandonOn Apr 6, 2005 12:50 PM, Dan Tenenbaum [EMAIL PROTECTED] wrote: I am runninga query from ibatis and I get this error: java.lang.reflect.UndeclaredThrowableException at $Proxy9.getVisibleSelectedIds(Unknown Source) at (...) ... 18 more Caused by: com.ibatis.dao.client.DaoException: Error executing query for list.Cause: com.ibatis.common.jdbc.exception.NestedSQLException: --- The error occurred while applying a parameter map. --- Check the getVisibleSelectedTopicIds-InlineParameterMap. --- Check the results (failed to retrieve results). --- Cause: java.lang.NullPointerException Caused by: java.lang.NullPointerException Caused by: com.ibatis.common.jdbc.exception.NestedSQLException: --- The error occurred while applying a parameter map. --- Check the getVisibleSelectedTopicIds-InlineParameterMap. --- Check the results (failed to retrieve results). --- Cause: java.lang.NullPointerException Caused by: java.lang.NullPointerException (...) However, the logger output of the query in question is as follows: 11:41:56,523 DEBUG PreparedStatement:28 - {pstm-100138} PreparedStatement: select id from topics where id in
(?
,
?
)and id not in ( select topic_key from topic_eligibility where is_visible = false and sponsor_key in
(
?,?)
) order by patient_title 11:41:56,524 DEBUG PreparedStatement:29 - {pstm-100138} Parameters: [125, 126, 1, 2] 11:41:56,525 DEBUG PreparedStatement:30 - {pstm-100138} Types: [java.lang.Integer, java.lang.Integer, java.lang.Integer, java.lang.Integer] 11:41:56,530 DEBUG ResultSet:24 - {rset-100139} ResultSet (The funny spacing in the SQL query is due to it being in an xml file, and some of it comes from the iterate tag.) Anyway, if I take that query (from the logger output) and paste it into a database client, and replace the question marks with the parameters output by the logger above, the query runs and returns data, just as I expect it to. (The database is in exactly the same state). So why is it that I can run this query manually, but when run from IBATIS it doesn't return data? I have actually run into a couple of cases where iBATIS threw an error that turned out to be about something other than what it claimed. But in this case, it really does seem to be this query, because I have isolated it from everything else to verify that. Thanks

Re: About MySQL Driver Properties in transactionManager

2005-04-07 Thread Larry Meadors
that used to work in 1.x, but i have not tried it in 2.xOn Apr 7, 2005 3:59 AM, Akihiro Kubota [EMAIL PROTECTED] wrote: transactionManager type=JDBC dataSource type=SIMPLEproperty
name=JDBC.Driver value=com.mysql.jdbc.Driver / property name=JDBC.ConnectionURL value=jdbc:mysql://localhost:3306/exam?zeroDateTimeBehavior=convertToNull /property
name=JDBC.Username value=${username} /property
name=JDBC.Password value=${password} /property
name=JDBC.DefaultAutoCommit value=true/property
name=Pool.MaximumActiveConnections value=15 /property
name=Pool.MaximumIdleConnections value=15 /property
name=Pool.MaximumWait value=1000 / /dataSource/transactionManager As you can see the BOLD part of the mysqlconfig.xml file. Is there a way for the transactionManager to include properties specific to the database? For example like :...property
name=JDBC.Driver value=com.mysql.jdbc.Driver / property name=JDBC.ConnectionURL value=jdbc:mysql://localhost:3306/exam? / property name=JDBC.Driver.zeroDateTimeBehavior value=convertToNull/property
name=JDBC.Username value=${username} /property
name=JDBC.Password value=${password} / I will really appreciate for this kind of change. Thanks!

Re: Support for oracle cursors as resultsets

2005-04-07 Thread Brandon Goodin
We appreciate all you help. The best thing you can do it to checkout
the ibatis source from SVN. Make the change in accordance with the
proposed solution in JIRA. Then attach a patch to thie issue for
review.

Thanks
Brandon

On Apr 7, 2005 6:08 AM, Grassi Fabio [EMAIL PROTECTED] wrote:
  
 The support for oracle ref cursors both as stored-function results and as
 out stored-procedure parameters is critical for me as well. I have a
 not-so-small code base (150-200 stored procedures) I currently access to
 through Oracle JPublisher. I would like to dismiss JPublisher in favour of a
 more general pourpose data mapping framework like iBatis. 
   
 The enhacements I would need have somehow been anticipated in: 
 
 http://issues.apache.org/jira/browse/IBATIS-53?page=comments#action_57838
 
 and are: 
   
 1) Support for returning Oracle ref cursors as function results as well as
 out procedure parameters. 
 2) Support for declarative mapping of ref cursor fields to bean properties
 (for instance by adoption of resultMap attribute for parameter element). 
   
 I am willing to contribute to the coding and testing effort. Please let me
 know how to proceed. 
   
 Best regards, Fabio. 
   
   
   
 ORIGINAL MESSAGE BELOW 
 * 
  
 
 Graham Cruickshanks
 Fri, 01 Apr 2005 05:54:36 -0800 
 Hi,
 
 First of all I would like to say good work on putting together the excellent
 Ibatis. I would like to use Ibatis in new project I'm working on, but it's
 for a commercial entity and the oracle cursors to resultset is a must. I
 would like to help extend Ibatis to add better support of the Oracle
 dialect. Not for the companies sake, but for the sanity of not writing
 another straight JDBC to Stored procedure class again!!
 
 
 There are some patches kicking about for SqlExecutor.java on JIRA that are
 pretty 'patchy', is there any thoughts on adding a dialect factory to this
 class with a default dialect for each function and subclass overrides?
 
 Please let me known if any help would be useful.
 
 Cheers
 
 Graham Cruickshanks
 Ai sensi del D.Lgs. 196/2003 si precisa che le informazioni contenute in
 questo messaggio sono riservate ed a uso esclusivo del destinatario. Qualora
 il messaggio in parola Le fosse pervenuto per errore, La invitiamo ad
 eliminarlo senza copiarlo e a non inoltrarlo a terzi, dandocene gentilmente
 comunicazione. Grazie.
 
 Pursuant to Legislative Decree No. 196/2003, you are hereby informed that
 this message contains confidential information intended only for the use of
 the addressee. If you are not the addressee, and have received this message
 by mistake, please delete it and immediately notify us. You may not copy or
 disseminate this message to anyone. Thank you.



R: Support for oracle cursors as resultsets

2005-04-07 Thread Grassi Fabio
Sorry everybody, I finally found it. Fabio.Will you please point me to the SVN repository? I looked for it but only found the source for the stable version. Thanks in advance, Fabio.> -Messaggio originale-> Da: Brandon Goodin [mailto:[EMAIL PROTECTED] > Inviato: giovedì 7 aprile 2005 16:15> A: ibatis-user-java@incubator.apache.org> Oggetto: Re: Support for oracle cursors as resultsets> > > We appreciate all you help. The best thing you can do it to checkout> the ibatis source from SVN. Make the change in accordance with the> proposed solution in JIRA. Then attach a patch to thie issue for> review.> > Thanks> Brandon> > On Apr 7, 2005 6:08 AM, Grassi Fabio > <[EMAIL PROTECTED]> wrote:> >  > > The support for oracle ref cursors both as stored-function > results and as> > out stored-procedure parameters is critical for me as well. I have a> > not-so-small code base (150-200 stored procedures) I > currently access to> > through Oracle JPublisher. I would like to dismiss > JPublisher in favour of a> > more general pourpose data mapping framework like iBatis. > >   > > The enhacements I would need have somehow been anticipated in: > > > > > http://issues.apache.org/jira/browse/IBATIS-53?page=comments#a> ction_57838> > > > and are: > >   > > 1) Support for returning Oracle ref cursors as function > results as well as> > out procedure parameters. > > 2) Support for declarative mapping of ref cursor fields to > bean properties> > (for instance by adoption of resultMap attribute for > parameter element). > >   > > I am willing to contribute to the coding and testing > effort. Please let me> > know how to proceed. > >   > > Best regards, Fabio. > >   > >   > >   > > ORIGINAL MESSAGE BELOW > > * > >  > > > > Graham Cruickshanks> > Fri, 01 Apr 2005 05:54:36 -0800 > > Hi,> > > > First of all I would like to say good work on putting > together the excellent> > Ibatis. I would like to use Ibatis in new project I'm > working on, but it's> > for a commercial entity and the oracle cursors to resultset > is a must. I> > would like to help extend Ibatis to add better support of the Oracle> > dialect. Not for the companies sake, but for the sanity of > not writing> > another straight JDBC to Stored procedure class again!!> > > > > > There are some patches kicking about for SqlExecutor.java > on JIRA that are> > pretty 'patchy', is there any thoughts on adding a dialect > factory to this> > class with a default dialect for each function and subclass > overrides?> > > > Please let me known if any help would be useful.> > > > Cheers> > > > Graham Cruickshanks> > Ai sensi del D.Lgs. 196/2003 si precisa che le informazioni > contenute in> > questo messaggio sono riservate ed a uso esclusivo del > destinatario. Qualora> > il messaggio in parola Le fosse pervenuto per errore, La > invitiamo ad> > eliminarlo senza copiarlo e a non inoltrarlo a terzi, > dandocene gentilmente> > comunicazione. Grazie.> > > > Pursuant to Legislative Decree No. 196/2003, you are hereby > informed that> > this message contains confidential information intended > only for the use of> > the addressee. If you are not the addressee, and have > received this message> > by mistake, please delete it and immediately notify us. You > may not copy or> > disseminate this message to anyone. Thank you.> >> Ai sensi del D.Lgs. 196/2003 si precisa che le informazioni contenute in questo messaggio sono riservate ed a uso esclusivo del destinatario. Qualora il messaggio in parola Le fosse pervenuto per errore, La invitiamo ad eliminarlo senza copiarlo e a non inoltrarlo a terzi, dandocene gentilmente comunicazione. Grazie.Pursuant to Legislative Decree No. 196/2003, you are hereby informed that this message contains confidential information intended only for the use of the addressee. If you are not the addressee, and have received this message by mistake, please delete it and immediately notify us. You may not copy or disseminate this message to anyone. Thank you.

RE: ibatis technology need company references.

2005-04-07 Thread Mark Bennett
I know you're looking for product references but to give you more ammo you
should make a hard copy of the Data Mapper Development Guide and bring that
to your meetings as well.  It is an impressive document.

Mark

-Original Message-
From: Victor Stepanov [mailto:[EMAIL PROTECTED]
Sent: Wednesday, April 06, 2005 11:56 AM
To: ibatis-user-java@incubator.apache.org
Subject: ibatis technology need company references.


Hi All.
I need to provide references about ibatis and sqlmaps that this product
is stable can anybody give some references or where I can found it.
Thanks.




Bidirectional parent-child relationship and groupBy

2005-04-07 Thread Oscar Picasso
Hi,

I have something like that:

class Category
{
  int id;
  ListSubcategory subcategories;
  
  ..getters and setters
}

class Subcategory
{
  int id;
  Category parent;
  
  ..getters and setters
}


A groupBy in the Category resultMap loads the related subcategories. 

However while loading these subcategories, I would like each subcategory parent
to be set.

I can use lazy loading but it can set a different parent for the subcategories
under a same Category (!= identity = more objects created).

Is there a mean to do that in the result Map (set the subcategory parent to the
same Category in a group).

Currently, I do it in the dao code but I don't find this solution very clean.

Thanks.

Oscar



__ 
Yahoo! Messenger 
Show us what our next emoticon should look like. Join the fun. 
http://www.advision.webevents.yahoo.com/emoticontest


Passing an XML document as a parameter to SqlMapClient methods

2005-04-07 Thread Mark Nabours




I understand that passing an XML document (W3C, JDOM, ??) as a parameter to
the SqlMapClient's methods (insert, update, queryForList, etc.) is a
undocumented feature of iBATIS
(http://wiki.apache.org/ibatis/Not_yet_Documented).

Does anyone have any examples of using this feature?

Thanks in advance for your help,
Mark


-
E-mail Disclaimer:  The information contained in this e-mail, and in any
accompanying  documents, may constitute confidential and/or legally
privileged  information.  The information is intended only for use by the
designated recipient.  If you are not the intended recipient (or
responsible for the delivery of the message to the intended recipient),
you are hereby notified that any dissemination, distribution, copying,  or
other use of, or taking of any action in reliance on this e-mail  is
strictly prohibited. If you have received this email communication  in
error, please notify the sender immediately and delete the message  from
your system.



Nested Beans?

2005-04-07 Thread Nic Werner
Greetings,
   The archives aren't searchable right now 
(http://incubator.apache.org/ibatis/site/mailinglists.html), so I have 
this question:

I have a Bean (Reservation), with another Bean (Device) inside it. My 
database just contains the DeviceID in the Reservation table - where/how 
can I use the getter inside the nestedbean to get this DeviceID out?

Thanks,
- Nic.


Re: Nested Beans?

2005-04-07 Thread Brandon Goodin
You can use '.'  (dot) notation. So, if you pass in Reservation as
your parameter class you can acess the device id with 'device.id'
(assuming 'id' is the name of your id propety in the Device class)

Brandon

On Apr 7, 2005 12:58 PM, Nic Werner [EMAIL PROTECTED] wrote:
 Greetings,
 The archives aren't searchable right now
 (http://incubator.apache.org/ibatis/site/mailinglists.html), so I have
 this question:
 
 I have a Bean (Reservation), with another Bean (Device) inside it. My
 database just contains the DeviceID in the Reservation table - where/how
 can I use the getter inside the nestedbean to get this DeviceID out?
 
 Thanks,
 
 - Nic.



Please Help in arguing for iBatis SqlMaps

2005-04-07 Thread Kaushik Ashodiya


Hi,
I have hard time arguing for iBatis SqlMaps (not because something wrong
with SqlMaps).
Please give me more reasons so that I can convince them.
Their argument:
1. For small project SqlMap is adding unnecessary complexity.
2. Why learn one more tool when you have a simple base data access object
that gives you connection, prepared statement and a result and does
cleanup? (only when extended class calls cleanup() !!!)
3. Generally open source projects dies shortly and does not have
support.
4. Adding many jars of those open source projects make out project more
complex and un-maintainable.
5. What if SqlMaps goes out of market? It is fairly new and not
hardened.


my-peers-arguments
Again to re-iterate a point I was trying to
make yesterday, architecturally speaking you should always try and keep
it simple (not on an individual application level) but as far as possible
on an enterprise level. I'm going to ask you the same question that
I asked yesterday...what do you think are the advantages/disadvantages of
O/R mappings for relatively small applications where persistance is not
the deciding criteria (or for that matter not even a criteria)?(I've
attached yesterdays email thread for Kevin since he didn't get that one
:))

I'll list the disadvantages:
1) You add multiple third party jars (open source or otherwise), which
you need to be aware of when building new apps. These include
components which the vendor will eventually provide if the market demand
is high...
2)You add multiple configurations for each of those products, which you
need to understand on how to tune in case there are performance
issues.
3) Most of these components seem to be build on the current versions of
jdk which take a decent time to hit mainstream commercial product
support.
4) If these products are not built to a spec (even though they may end up
driving a spec), the migration process becomes an added overhead.
Even when they do become a part of the spec, the implementation
differences of the vendor of choice may be so different that you pretty
much waste any advantage of early adoption. If you are a vendor of
a product, an effective early adoption can translate into you either
being bought out by the bigger established vendor or you getting to be a
key player in that spacebut we don't fall in that category.
5)You need to be able to train existing resources to use the product
(unless there is a plan to let go people and get new fresh
resources who may have had experience with the adopted product).
Now if the existing resources themselves have a discomfort moving over to
an object oriented paradigm, putting up them up against the challenges of
going thru the learning curve of extra products further lowers the
probability of success.
6) You increase the possibility of chaos and reduce flexibility of
resource utilization.

Besides the six points above, I would not recommend use of products like
iBatis in applications at UCOP is because in my opinion the applications
that we do or have done are relatively small and O/R mapping for those
kinds of apps is probably an overkill (again personal opinion.) To
some level Hibernate is a valid candidate for evaluation (taking into
account that it is driving the EJB spec). But again, my business acumen
says that IBM will definitely take care of that. 

Now my perpective looking at the example below, one of the key
shortcommings that I see is it couples the Display/View with
the model (Data Access) Basically what this means is that if you
wanted to create the same object tomorrow from not a non
database/jndi source, you would be re-writing the logic for creating the
same object. Another disadantage that I mentioned yesterday was if
your display object gets created from multiple datasources (one db2, one
sybase) transaction management becomes an issue How would you
use iBatis in a system which does not need persistanc but needs
transaction management?

Isn't the whole idea of going with some big commercial vendor like IBM to
consolidate your infrastructure source so that you dont knock on
different doors? Often such a vendor is selected based on how many
services required by a business are provided by the vendor. Nothing
against Hibernate or iBatis. I'm sure they are great at what they
are designed to do. But each one of them doesn;t do all that we
probably need (they still need an underlying EJB container.)
If thats the case, why would you want to introduce the additional
learning curve and the additional layer associated with each product? Do
you truely think that it's a necessity? 


Short of long: I would recommend usage of vendor supported spec based ejb
conatiner for applications needing persistance or transaction
management. Eventually these will be simplified (if there is fear
of complexitythats an issue the specs and the commercial vendors like
IBM will definitely answer). If persistance is not required, use
the existing framework component. What that does is you dont 

Re: Please Help in arguing for iBatis SqlMaps

2005-04-07 Thread Mark Bennett
Wow, I think this is going to be a fun thread.


On Apr 7, 2005 1:55 PM, Kaushik Ashodiya [EMAIL PROTECTED] wrote:
 Hi,
 
 I have hard time arguing for iBatis SqlMaps (not because something wrong
 with SqlMaps).
 
 Please give me more reasons so that I can convince them.
 
 Their argument:
 1. For small project SqlMap is adding unnecessary complexity.
 2. Why learn one more tool when you have a simple base data access object
 that gives you connection, prepared statement and a result and does cleanup?
 (only when extended class calls cleanup() !!!)
 3. Generally open source projects dies shortly and does not have support.
 4. Adding many jars of those open source projects make out project more
 complex and un-maintainable.
 5. What if SqlMaps goes out of market? It is fairly new and not hardened.
  
 
 
 
 my-peers-arguments
 Again to re-iterate a point I was trying to make yesterday, architecturally
 speaking you should always try and keep it simple (not on an individual
 application level) but as far as possible on an enterprise level.  I'm going
 to ask you the same question that I asked yesterday...what do you think are
 the advantages/disadvantages of O/R mappings for relatively small
 applications where persistance is not the deciding criteria (or for that
 matter not even a criteria)?(I've attached yesterdays email thread for Kevin
 since he didn't get that one :))
  
 I'll list the disadvantages:
 1) You add multiple third party jars (open source or otherwise), which you
 need to be aware of when building new apps.  These include components which
 the vendor will eventually provide if the market demand is high...
 2)You add multiple configurations for each of those products, which you need
 to understand on how to tune in case there are performance issues.
 3) Most of these components seem to be build on the current versions of jdk
 which take a decent time to hit mainstream commercial product support.
 4) If these products are not built to a spec (even though they may end up
 driving a spec), the migration process becomes an added overhead.  Even when
 they do become a part of the spec, the implementation differences of the
 vendor of choice may be so different that you pretty much waste any
 advantage of early adoption.  If you are a vendor of a product, an effective
 early adoption can translate into you either being bought out by the bigger
 established vendor or you getting to be a key player in that spacebut we
 don't fall in that category.
 5)You need to be able to train existing resources to use the product (unless
 there is a plan to let go people and get new fresh resources who may have
 had experience with the adopted product).  Now if the existing resources
 themselves have a discomfort moving over to an object oriented paradigm,
 putting up them up against the challenges of going thru the learning curve
 of extra products further lowers the probability of success.
 6) You increase the possibility of chaos and reduce flexibility of resource
 utilization.
  
 Besides the six points above, I would not recommend use of products like
 iBatis in applications at UCOP is because in my opinion the applications
 that we do or have done are relatively small and O/R mapping for those kinds
 of apps is probably an overkill (again personal opinion.)  To some level
 Hibernate is a valid candidate for evaluation (taking into account that it
 is driving the EJB spec). But again, my business acumen says that IBM will
 definitely take care of that.   
  
 Now my perpective looking at the example below, one of the key shortcommings
 that I see is it couples the Display/View with the model (Data Access)
 Basically what this means is that if you wanted to create the same object
 tomorrow from not a non database/jndi source, you would be re-writing the
 logic for creating the same object.  Another disadantage that I mentioned
 yesterday was if your display object gets created from multiple datasources
 (one db2, one sybase) transaction management becomes an issue  How would
 you use iBatis in a system which does not need persistanc but needs
 transaction management?
  
 Isn't the whole idea of going with some big commercial vendor like IBM to
 consolidate your infrastructure source so that you dont knock on different
 doors? Often such a vendor is selected based on how many services required
 by a business are provided by the vendor. Nothing against Hibernate or
 iBatis.  I'm sure they are great at what they are designed to do.  But each
 one of them doesn;t do all that we probably need  (they still  need an
 underlying EJB container.) If thats the case, why would you want to
 introduce the additional learning curve and the additional layer associated
 with each product? Do you truely think that it's a necessity?  
  
  
 Short of long: I would recommend usage of vendor supported spec based ejb
 conatiner for applications needing persistance or transaction management. 
 Eventually these will be 

Re: Please Help in arguing for iBatis SqlMaps

2005-04-07 Thread NetSQL
Kaushik Ashodiya wrote:
Hi,
I have hard time arguing for iBatis SqlMaps (not because something 
wrong with SqlMaps).

Please give me more reasons so that I can convince them.
Their argument:
1. For small project SqlMap is adding unnecessary complexity.
2. Why learn one more tool when you have a simple base data access 
object that gives you connection, prepared statement and a result and 
does cleanup? (only when extended class calls cleanup() !!!)
3. Generally open source projects dies shortly and does not have support.
4. Adding many jars of those open source projects make out project 
more complex and un-maintainable.
5. What if SqlMaps goes out of market? It is fairly new and not hardened.
 


my-peers-arguments
Again to re-iterate a point I was trying to make yesterday, 
architecturally speaking you should always try and keep it simple (not 
on an individual application level) but as far as possible on an 
enterprise level.  I'm going to ask you the same question that I asked 
yesterday...what do you think are the advantages/disadvantages of O/R 
mappings for relatively small applications where persistance is not 
the deciding criteria (or for that matter not even a criteria)?(I've 
attached yesterdays email thread for Kevin since he didn't get that 
one :))
 
I'll list the disadvantages:
1) You add multiple third party jars (open source or otherwise), which 
you need to be aware of when building new apps.

Re-use of working thing... vs writing your own bugs and documenting.
These include components which the vendor will eventually provide if 
the market demand is high...
2)You add multiple configurations for each of those products, which 
you need to understand on how to tune in case there are performance 
issues.

If you don't need cache, don't use it. Else set # of minutes.
3) Most of these components seem to be build on the current versions 
of jdk which take a decent time to hit mainstream commercial product 
support.

?? vs what?
4) If these products are not built to a spec (even though they may end 
up driving a spec), the migration process becomes an added overhead.  
Even when they do become a part of the spec, the implementation 
differences of the vendor of choice may be so different that you 
pretty much waste any advantage of early adoption.  If you are a 
vendor of a product, an effective early adoption can translate into 
you either being bought out by the bigger established vendor or you 
getting to be a key player in that spacebut we don't fall in that 
category.

Yeah, JST # 123 vs Apache. Which is more standard?
5)You need to be able to train existing resources to use the product 
(unless there is a plan to let go people and get new fresh resources 
who may have had experience with the adopted product).  Now if the 
existing resources themselves have a discomfort moving over to an 
object oriented paradigm, putting up them up against the challenges of 
going thru the learning curve of extra products further lowers the 
probability of success.
Maybe good docs would help. And make it stnadarad ANSI SQL.
6) You increase the possibility of chaos and reduce flexibility of 
resource utilization.
 
Besides the six points above, I would not recommend use of products 
like iBatis in applications at UCOP is because in my opinion the 
applications that we do or have done are relatively small and O/R 
mapping for those kinds of apps is probably an overkill (again 
personal opinion.)

Maybe better to avoid hevy O/R.
To some level Hibernate is a valid candidate for evaluation (taking 
into account that it is driving the EJB spec). But again, my business 
acumen says that IBM will definitely take care of that.  
IBM does have a J2EE reputation. Like it's the worst.
 
Now my perpective looking at the example below, one of the key 
shortcommings that I see is it couples the Display/View with the 
model (Data Access) Basically what this means is that if you 
wanted to create the same object tomorrow from not a non 
database/jndi source, you would be re-writing the logic for creating 
the same object.  Another disadantage that I mentioned yesterday was 
if your display object gets created from multiple datasources (one 
db2, one sybase) transaction management becomes an issue  How 
would you use iBatis in a system which does not need persistanc but 
needs transaction management?
 
Isn't the whole idea of going with some big commercial vendor like IBM 
to consolidate your infrastructure source so that you dont knock on 
different doors? Often such a vendor is selected based on how many 
services required by a business are provided by the vendor. Nothing 
against Hibernate or iBatis.  I'm sure they are great at what they are 
designed to do.  But each one of them doesn;t do all that we probably 
need  (they still  need an underlying EJB container.)

Hibreante and iBatis don't.
If thats the case, why would you want to introduce the additional 
learning curve and the additional layer 

Re: Please Help in arguing for iBatis SqlMaps

2005-04-07 Thread Brandon Goodin
You know... I can appreciate an informed opinion. But, your peer is
clearly lacking in his assessment. All i can say is that you peer has
some absurd notions and ridiculous antidotes. They clearly don''t
understand the nature of the technologies they are talking about. I
really don't feel like fighting against egregious and irresponsible
ignorance. I'd much rather discuss intelligent objections and ideas.
However, i'll throw in a few comments. I truly don't care to get mixed
any deeper into this.

--

Their argument:
1. For small project SqlMap is adding unnecessary complexity.

This is ridiculous. It adds simplicity. That is it's nature. JDBC MADE
EASIER. iBatis handles all the mundane work that would do by hand
coding JDBC anyways. So, where is the complexity? I've used iBatis on
complex and simple systems alike.

2. Why learn one more tool when you have a simple base data access
object that gives you connection, prepared statement and a result and
does cleanup? (only when extended class calls cleanup() !!!)

Not sure if you are referring to a home spun solution or jdbc.
Regardless, it is still a mute point. iBatis is super easy to
understand. It is an OSS project that has the support of a strong
community and therefore relieves you from having to maintain the code
base alone.

3. Generally open source projects dies shortly and does not have support.

I can't say how ridiculous this is. Look throughout the history of
technology. It is the OSS products that have survived and thrived
across the years  But, let me say, that is why we have joined the
Apache group. Apache has a rigorous process of analysis to make sure
that the projects it adopts are long living projects with a happy
healthy community. BTW iBatis has thrived on it's own for over 2 years
now. We are hardly short lived. Also, we have a .NET version of our
framework and there is discussion of a PHP  and Ruby version.

4. Adding many jars of those open source projects make out project
more complex and un-maintainable.

This one is hardly worth commenting on. What project does not include
jars? Are they suggesting that proprietary products somehow have less?
Wow, ignorance abounds. However, let me also say that iBatis goes
through great care to reduce dependencies on jars. We have very few
dependencies and most of them you would need anyways with a database
project.

5. What if SqlMaps goes out of market? It is fairly new and not hardened.

Will SQL go out of market? Will JDBC go out of market? answer those
questions and you will have your answer.

--

RE: my-peers-arguments

1) You add multiple third party jars (open source or otherwise),
which you need to be aware of when building new apps.  These include
components which the vendor will eventually provide if the market
demand is high...

The vendor generally foists copious amounts of unnecessary crap on you
as it is. Wouldn't it be nicer if you have a clean decisive stack.
Your peer seems to be contradicting themselves.

So, jars are okay to fill your project so long as they come from a vendor? 

2)You add multiple configurations for each of those products, which
you need to understand on how to tune in case there are performance
issues.

iBatis tuning is simple and the config files are simple too. If you
can or do code JDBC you can iBatis. The configurations are merely
containers for your SQL code. If that's too much for someone then i
suppose they should find a new means to access the database with Java.

3) Most of these components seem to be build on the current versions
of jdk which take a decent time to hit mainstream commercial product
support.

iBatis is JDK 1.3 compatible

4) If these products are not built to a spec (even though they may
end up driving a spec), the migration process becomes an added
overhead.  Even when they do become a part of the spec, the
implementation differences of the vendor of choice may be so different
that you pretty much waste any advantage of early adoption.  If you
are a vendor of a product, an effective early adoption can translate
into you either being bought out by the bigger established vendor or
you getting to be a key player in that spacebut we don't fall in
that category.

Okay another nonsense argument. It's not a spec. But, if it was a spec
we would face the same problem as those things that are not a spec.
What exactly is this person arguing? Do they want to write everything
by hand internally and avoid external dependency? Think of this... if
by some chance ibatis stopped... you could pick up the ball and keep
coding it. Or if your buddy thinks that using some framework that has
been established by a large corporation will somehow serve you better
then that is silly too. Every product has it's lifecycle and upgrading
is a reality. However, with iBatis we have gone through significant
effort to make those transitions easier. You only see backward
breakage when it comes to version releases. 

Re: Passing an XML document as a parameter to SqlMapClient methods

2005-04-07 Thread Clinton Begin

There are unit tests for this feature...both DOM and String based XML

PS: Sorry the tests are kind of messy at this point...but they're there.

Cheers,
ClintonOn Apr 7, 2005 11:19 AM, Mark Nabours [EMAIL PROTECTED] wrote:I understand that passing an XML document (W3C, JDOM, ??) as a parameter tothe SqlMapClient's methods (insert, update, queryForList, etc.) is aundocumented feature of iBATIS(http://wiki.apache.org/ibatis/Not_yet_Documented).Does anyone have any examples of using this feature?Thanks in advance for your help,Mark-E-mail Disclaimer:The information contained in this e-mail, and in anyaccompanyingdocuments, may constitute confidential and/or legallyprivilegedinformation.The information is intended only for use by thedesignated recipient.If you are not the intended recipient (orresponsible for the delivery of the message to the intended recipient),you are hereby notified that any dissemination, distribution, copying,orother use of, or taking of any action in reliance on this e-mailisstrictly prohibited. If you have received this email communicationinerror, please notify the sender immediately and delete the messagefromyour system.

Re: Please Help in arguing for iBatis SqlMaps

2005-04-07 Thread Larry Meadors
Heheheh, this is funny.

OK, here is an iBATIS application. 

It is not the best example, but it shows how nonsensical this statement
is: For small project SqlMap is adding unnecessary complexity.

===
Main.java
===
package blah;

import com.ibatis.sqlmap.client.SqlMapClientBuilder;
import com.ibatis.sqlmap.client.SqlMapClient;
import com.ibatis.common.resources.Resources;
import java.io.Reader;
import java.util.List;

public class Main {
 public static void main(String arg[]) throws Exception {
 String resource;
 Reader reader;
 List list;
 SqlMapClient sqlMap;
 resource = blah/SqlMapConfig.xml;
 reader = Resources.getResourceAsReader (resource);
 sqlMap = SqlMapClientBuilder.buildSqlMapClient(reader);
 list = sqlMap.queryForList(getAll, null);
 System.out.println(Selected  + list.size() +  records.);
 System.out.println();
 for(int i = 0; i  list.size(); i++) {
 System.out.println(list.get(i));
 }
 System.out.println();
 }
}
===
OH! I almost forgot the configuration files!


===
SqlMapConfig.xml
===
?xml version=1.0 encoding=UTF-8 ?
!DOCTYPE sqlMapConfig
 PUBLIC -//iBATIS.com//DTD SQL Map Config 2.0//EN
 http://www.ibatis.com/dtd/sql-map-config-2.dtd
sqlMapConfig
 settings cacheModelsEnabled=true
 enhancementEnabled=true
 lazyLoadingEnabled=true maxRequests=32
 maxSessions=10 maxTransactions=5
 useStatementNamespaces=false /
 transactionManager type=JDBC 
 dataSource type=SIMPLE
 property name=JDBC.Driver value=com.mysql.jdbc.Driver/
 property name=JDBC.ConnectionURL value=jdbc:mysql://localhost/test/
 property name=JDBC.Username value=root/
 property name=JDBC.Password value=/
 /dataSource
 /transactionManager
 sqlMap resource=org/apache/mapper2/ii15/SqlMap.xml /
/sqlMapConfig
===

And here is the second one:

===
SqlMap.xml

===
?xml version=1.0 encoding=UTF-8 ?
!DOCTYPE sqlMap
 PUBLIC -//iBATIS.com//DTD SQL Map 2.0//EN
 http://www.ibatis.com/dtd/sql-map-2.dtd
sqlMap namespace=ii15
 select id=getAll resultClass=java.util.HashMap
 select * from user
 /select
/sqlMap
===

Now, where is the complexity?

I think brandon may have hit the nail on the head...who wrote the framework that your peer wants to use?

Larry


Re: Please Help in arguing for iBatis SqlMaps

2005-04-07 Thread Clinton Begin
Hi Kaushik,

I was going to respond with a technical rebuttal, until I read: my business acumen
says that IBM will definitely take care of that. (apparently from your supervisor or something)

Let me instead tell you how IBM made $96 Billion dollars in 2004.
Or you can read it yourself at:
http://www.ibm.com/investor/filings/index.phtml
IBM basically makes money in two ways: 1) By selling software
(that may or may not work) and 2) By selling services to help you
with that software. The profit from these services is about 50/50
and together they make up 70% of their total profits (their proprietary
hardware makes up another 25%).

Because 35% of IBM profit depends on also selling you services, it's in
their best intersts to offer you products that are over complicated,
underdocumented and that generally don't work well (i.e.
WebSphere). It simply makes business sense. If you doubt my
motives for this, let's look at how IBM spends their money.

All of IBMs expenses can be categorized in two areas: 1) Sales,
General and Administration and 2) Research, Development and
Engineering. They spend 80% of their money on SGA and a
measly 20% of it on RDE. 

So, when we look at how IBM makes and spends money we see this:

* IBM depends on selling you complex software and proprietary hardware
* IBM depends on selling you services to support, extend and maintain that software and hardware
* IBM spends 4x more money on SELLING you these things, than IMPROVING them
* IBM makes you pay for all of this up front, but you won't know how bad it really is until your project fails
* IBM is a sales organization that succeeds in business by taking your executives out for lunch.

In contrast, open source software:

* Depends on compatibility and openess to achieve network effect
* Depends on an energetic community of smart people to keep it alive
* Spends 100% of resources on IMPROVING the software and none on selling it (except for this thread) ;-)
* You don't pay a dime for it EVER whether your project succeeds or fails...you're never any worse off

Open source software succeeds solely on its merits.

Chances are your organization will still choose to buy into IBM (or
Sun, or HP, or Microsoft, or ...). I see it happen every day in
large companies. The other nice thing about open source software
though, is that no matter what your boss chooses...I don't lose a
dime. ;-)

Cheers,
Clinton
On Apr 7, 2005 10:55 AM, Kaushik Ashodiya [EMAIL PROTECTED] wrote:

Hi,
I have hard time arguing for iBatis SqlMaps (not because something wrong
with SqlMaps).
Please give me more reasons so that I can convince them.
Their argument:
1. For small project SqlMap is adding unnecessary complexity.
2. Why learn one more tool when you have a simple base data access object
that gives you connection, prepared statement and a result and does
cleanup? (only when extended class calls cleanup() !!!)
3. Generally open source projects dies shortly and does not have
support.
4. Adding many jars of those open source projects make out project more
complex and un-maintainable.
5. What if SqlMaps goes out of market? It is fairly new and not
hardened.


my-peers-arguments
Again to re-iterate a point I was trying to
make yesterday, architecturally speaking you should always try and keep
it simple (not on an individual application level) but as far as possible
on an enterprise level. I'm going to ask you the same question that
I asked yesterday...what do you think are the advantages/disadvantages of
O/R mappings for relatively small applications where persistance is not
the deciding criteria (or for that matter not even a criteria)?(I've
attached yesterdays email thread for Kevin since he didn't get that one
:))

I'll list the disadvantages:
1) You add multiple third party jars (open source or otherwise), which
you need to be aware of when building new apps. These include
components which the vendor will eventually provide if the market demand
is high...
2)You add multiple configurations for each of those products, which you
need to understand on how to tune in case there are performance
issues.
3) Most of these components seem to be build on the current versions of
jdk which take a decent time to hit mainstream commercial product
support.
4) If these products are not built to a spec (even though they may end up
driving a spec), the migration process becomes an added overhead.
Even when they do become a part of the spec, the implementation
differences of the vendor of choice may be so different that you pretty
much waste any advantage of early adoption. If you are a vendor of
a product, an effective early adoption can translate into you either
being bought out by the bigger established vendor or you getting to be a
key player in that spacebut we don't fall in that category.
5)You need to be able to train existing resources to use the product
(unless there is a plan to let go people and get new fresh
resources who may have had experience with the adopted product).

Re: Please Help in arguing for iBatis SqlMaps

2005-04-07 Thread J.F. Zarama
Further help from IBM to newcomers on the subject include:

http://www-128.ibm.com/developerworks/db2/library/techarticle/dm-0502cline/
http://www-1.ibm.com/support/docview.wss?uid=swg4f0a6040763358eee85256f9c005cad80

http://www-128.ibm.com/developerworks/opensource/newto/
http://www-128.ibm.com/developerworks/opensource/library/os-merrier.html
http://www-128.ibm.com/developerworks/db2/library/techarticle/dm-0410prial/
http://www-128.ibm.com/developerworks/opensource/library/os-worldos.html
http://www-128.ibm.com/developerworks/xml/library/x-think15/index.html

jfz.


On Apr 7, 2005 11:34 PM, Clinton Begin [EMAIL PROTECTED] wrote:
 Hi Kaushik,
  
  I was going to respond with a technical rebuttal, until I read:  my
 business acumen says that IBM will definitely take care of that.
 (apparently from your supervisor or something)
  
  Let me instead tell you how IBM made $96 Billion dollars in 2004.  Or you
 can read it yourself at: 
 http://www.ibm.com/investor/filings/index.phtml
 
  IBM basically makes money in two ways:  1) By selling software (that may or
 may not work) and 2) By selling services to help you with that software. 
 The profit from these services is about 50/50 and together they make up 70%
 of their total profits (their proprietary hardware makes up another 25%).
  
  Because 35% of IBM profit depends on also selling you services, it's in
 their best intersts to offer you products that are over complicated,
 underdocumented and that generally don't work well (i.e. WebSphere).  It
 simply makes business sense.  If you doubt my motives for this, let's look
 at how IBM spends their money.
  
  All of IBMs expenses can be categorized in two areas:  1) Sales, General
 and Administration and 2) Research, Development and Engineering.  They spend
 80% of their money on SGA and a measly 20% of it on RDE. 
  
  So, when we look at how IBM makes and spends money we see this:
  
  * IBM depends on selling you complex software and proprietary hardware
  * IBM depends on selling you services to support, extend and maintain that
 software and hardware
  * IBM spends 4x more money on SELLING you these things, than IMPROVING them
  * IBM makes you pay for all of this up front, but you won't know how bad it
 really is until your project fails
  * IBM is a sales organization that succeeds in business by taking your
 executives out for lunch.
  
  In contrast, open source software:
  
  * Depends on compatibility and openess to achieve network effect
  * Depends on an energetic community of smart people to keep it alive
  * Spends 100% of resources on IMPROVING the software and none on selling it
 (except for this thread)  ;-)
  * You don't pay a dime for it EVER whether your project succeeds or
 fails...you're never any worse off
  
  Open source software succeeds solely on its merits.
  
  Chances are your organization will still choose to buy into IBM (or Sun, or
 HP, or Microsoft, or ...).  I see it happen every day in large companies. 
 The other nice thing about open source software though, is that no matter
 what your boss chooses...I don't lose a dime.  ;-)
  
  Cheers,
  Clinton
  
 On Apr 7, 2005 10:55 AM, Kaushik Ashodiya [EMAIL PROTECTED] wrote:
  Hi,
  
  I have hard time arguing for iBatis SqlMaps (not because something wrong
 with SqlMaps).
  
  Please give me more reasons so that I can convince them.
  
  Their argument:
  1. For small project SqlMap is adding unnecessary complexity.
  2. Why learn one more tool when you have a simple base data access object
 that gives you connection, prepared statement and a result and does cleanup?
 (only when extended class calls cleanup() !!!)
  3. Generally open source projects dies shortly and does not have support.
  4. Adding many jars of those open source projects make out project more
 complex and un-maintainable.
  5. What if SqlMaps goes out of market? It is fairly new and not hardened.
   
  
  
  
  my-peers-arguments
  Again to re-iterate a point I was trying to make yesterday,
 architecturally speaking you should always try and keep it simple (not on an
 individual application level) but as far as possible on an enterprise level.
  I'm going to ask you the same question that I asked yesterday...what do you
 think are the advantages/disadvantages of O/R mappings for relatively small
 applications where persistance is not the deciding criteria (or for that
 matter not even a criteria)?(I've attached yesterdays email thread for Kevin
 since he didn't get that one :))
   
  I'll list the disadvantages:
  1) You add multiple third party jars (open source or otherwise), which you
 need to be aware of when building new apps.  These include components which
 the vendor will eventually provide if the market demand is high...
  2)You add multiple configurations for each of those products, which you
 need to understand on how to tune in case there are performance issues.
  3) Most of these components seem to be build on the current versions of
 jdk