Re: Excessive memory usage (feature or bug?)

2009-01-24 Thread j-lists
This conversation inspired a rather off-topic question from me, in mysql are
you forced to hardcode the limit/offset in to the SQL like this?
limit $skip$, $max$

In Postgres they can bind as parameters:
limit #limit# offset #offset#

I'm not really a mysql user so I am curious...

-J

On Tue, Jan 20, 2009 at 5:46 PM, Jeff P  wrote:

>
> Thank you alot, Larry!!!
>
> It really scared the hell out of me when I checked the profiler and saw
> that
> 1 query used so much memory.
> I can confirm that using your technique reduced ram usage to 5mb (which is
> practically nothing!)
>
> Thanks again!
>
>
> Larry Meadors wrote:
> >
> > Ha, yeah, it's the driver for sure. You'll get the same results if you
> > prepare and execute the statement yourself instead of using ibatis.
> >
> > I remember when looked at the source for the pgsql driver some time
> > ago - it does a similar thing - it fetched the results of the query
> > into a big freaking byte[][] structure (assuming that you'll need it
> > all) then walked through it as I called rs.next().
> >
> > Even a RowHandler won't help because it's happening before ibatis gets
> > to touch the data - it happens when you execute the statement.
> >
> > Use the limit trick in your select statement. It's the only way to
> > prevent this problem if the driver does this.
> >
> > Larry
> >
> >
> > On Tue, Jan 20, 2009 at 11:34 AM, Jeff P 
> wrote:
> >>
> >> For what its worth... my profiler says the 3 biggest memory hogs are:
> >>
> >
> >
>
> --
> View this message in context:
> http://www.nabble.com/Excessive-memory-usage-%28feature-or-bug-%29-tp21568317p21574300.html
> Sent from the iBATIS - User - Java mailing list archive at Nabble.com.
>
>


Re: java.sql.SQLException: Already closed.

2009-02-09 Thread j-lists
Are you upgrading from a version before the two jars were merged into one? I
remember encountering a similar problem when the old second jar was
accidentally left in our classpath and in our lib directory.

-J

On Sun, Feb 8, 2009 at 10:40 PM, Larry Meadors wrote:

> What's the database?
>
> Larry
>


Re: KeyProperty attribute in Selectkey Tag

2009-02-12 Thread j-lists
Call me crazy Rahul, but if you are trying it then would you not
already know what type would be returned simply by examining the type
that is actually returned?
Judging by your code above the "resultClass='int'" above should mean
you are getting a java.lang.Integer back. I *think* it should also be
assigned to your object by calling setGeneratedSequenceId_0() during
the actual insert process (I always work with java.util.Maps myself so
I'm not up on all the bean stuff).

-J

On Thu, Feb 12, 2009 at 12:20 PM, Rahul Saluja  wrote:
>
> Jeff, I am writing (trying) it that's why I am asking question my friend, why 
> would I just keep writing mails.
>
> -Original Message-
> From: Jeff Butler [mailto:jeffgbut...@gmail.com]
> Sent: Thursday, February 12, 2009 11:43 PM
> To: user-java@ibatis.apache.org
> Subject: Re: KeyProperty attribute in Selectkey Tag
>
> Dude...seriously...*try it*.
>
> The insert statement always returns the value of the select key, or
> null if there is no select key.  In the example above, the return
> value is Integer.  The keyProperty attribute is there for just this
> instance - where you get the new key from a sequence before inserting.
>
> Jeff Butler
>
>
> On Thu, Feb 12, 2009 at 11:56 AM, Rahul Saluja  wrote:
> > Hey Bruke,
> >
> >
> >
> > Well I do have sequences defined for my each table which acts as a primary
> > key for my table now I want to use this generatedkey as a foreign key in
> > another table so now if I use my class attribute to have this sequence id ,
> > then how can I get that key in java code , I am assuming I can do in
> > following manner please tell me if I a, doing in a right way or not (my DB
> > is Postgres).
> >
> >
> >
> >  >
> > parameterClass="com.hns.hss.nmf.server.log.manager.gensrc.MSCPerformance.impl.MSCPerfCntrTrunkTblImpl">
> >
> >
> >
> >   
> >
> >   SELECT nextval('MSCPerfCntrTrunk_seq')
> >
> > 
> >
> >   insert into MSCPerfCntrTrunkTbl(
> >
> >
> >
> > seq_no,
> >
> >   neinfo_id,
> >
> >   rectimeStamp,
> >
> >   transactionId,
> >
> >   destNum_2,
> >
> >
> >
> >   )
> >
> > values
> >
> >   (
> >
> >   #generatedSequenceId_0#,
> >
> >   #neInfoId_0#,
> >
> >   #timeStamp_0#,
> >
> >   #transactionId_1.value#,
> >
> >   #count_2.value#,
> >
> >
> >
> >   )
> >
> >
> >
> >
> >
> > And in my  java code  if I am writing following statements
> >
> >
> >
> >
> > SqlMapClient.insert("MSCPerfCntrTrunkTblImpl",ObjectpointingtoMSCPerfCntrTrunkTblImpl)
> >
> >
> >
> > Above statement will return an Object but an object of what type??.
> >
> >
> >
> > Looking forward to your response.
> >
> >
> >
> > Regards
> >
> > Rahul Saluja
> >
> > 
> >
> > From: Burke.Kevin [mailto:kevin.bu...@cic.gc.ca]
> > Sent: Thursday, February 12, 2009 11:17 PM
> > To: user-java@ibatis.apache.org
> > Subject: RE: KeyProperty attribute in Selectkey Tag
> >
> >
> >
> > Rahul,
> >
> >
> >
> > My experience with this tag is you use it to define a query to determine
> > your primary key, in the absence of, say an IDENTITY column.
> >
> >
> >
> > You need to specify the keyProperty attribute if you want the following SQL
> > to be able to utilize the result of the query.  In the following example, I
> > utilize an integer based primary key column.  The following allows me to
> > manage the primary keys myself, without an auto-incrementing identity
> > column.
> >
> >
> >
> > Ex:
> >
> >   
> > SELECT max( pkey_column)+ 1 AS id from 
> >
> >   
> >
> >   INSERT INTO 
> >
> >   ( pkey_column,
> >
> >,
> >
> >,
> >
> >  ... )
> >
> >   VALUES
> >
> >( #id:INTEGER#,
> >
> > value,
> >
> > value,
> >
> > ...)
> >
> >
> >
> >
> >
> > I guess there is a possibility that you could have concurrency issues,
> > unless you synchronize access on the DAO methods invoking this statement.
> > Otherwise, you could experience another thread attemping an insert between
> > the  query to determine the next value, and the actual insert in
> > your statement.
> >
> >
> >
> > -Kevin
> >
> >
> >
> >
> >
> > -Original Message-
> > From: Rahul Saluja [mailto:rahul.sal...@vnl.in]
> > Sent: February 12, 2009 12:00 PM
> > To: user-java@ibatis.apache.org
> > Subject: RE: KeyProperty attribute in Selectkey Tag
> >
> >
> >
> > Does anybody care to reply.
> >
> >
> >
> >
> >
> > Please.
> >
> > 
> >
> > The information contained in this e-mail is private & confidential and may
> > also be legally privileged. If you are not the intended recipient, please
> > notify us, preferably by e-mail, and do not read, copy or disclose the
> > contents of this message to anyone.
> >
> The information contained in this e-mail is private & confidential and may 
> also be legally privileged. If you are not the intended recipient, please 
> notify us, preferably by e-mail, and do not read, copy or disclose the 
> contents of this message to anyone.


Re: DRY for clauses?

2009-11-23 Thread j-lists
http://opensource.atlassian.com/confluence/oss/display/IBATIS/How+do+I+reuse+SQL-fragments

On Mon, Nov 23, 2009 at 9:11 AM, Stephen Friedrich
 wrote:
> My application uses a lot of "manual" paging (using ROWNUM and nested selects 
> in Oracle PL/SQL).
> For each of these queries there is a second query that returns the total 
> number of results with _identical with-clause_ (sometimes quite complex).
> Does iBatis offer any help in avoiding these code duplicates?
>
> (Or does anybody know a better way, for example a way to retrieve both the 
> total count and a specific "page" in a single statement?)
>
> -
> To unsubscribe, e-mail: user-java-unsubscr...@ibatis.apache.org
> For additional commands, e-mail: user-java-h...@ibatis.apache.org
>
>

-
To unsubscribe, e-mail: user-java-unsubscr...@ibatis.apache.org
For additional commands, e-mail: user-java-h...@ibatis.apache.org



Re: ibatis, XML and special characters

2007-03-18 Thread j-lists

I would guess that this is a database encoding problem, have you
confirmed that the ">"s are causing a problem or just the non-ascii
characters? If the driver is getting generating invalid UTF16 for Java
(internally) that might be causing the failure... unfortunately this
is a real pain to debug and fix. Bulk loaders can fill varchars with
badly encoded text that give trouble.

Just a theory.
-J

On 3/12/07, Yuvraj Shinde <[EMAIL PROTECTED]> wrote:





You can use CDATA tag.



 


From: Ashish Kulkarni [mailto:[EMAIL PROTECTED]
 Sent: Monday, March 12, 2007 5:47 AM
 To: user-java@ibatis.apache.org
 Subject: ibatis, XML and special characters




Hi
 I am using ibatis to run a SQL statement which returns a XML as output as
shown below,

 
 SELECT P706DETL as SPECIALNOTE , PDLINE as PDLINENOTES FROM PU1706,
PU1013 WHERE P706ORD = PDPORD and PDSPEC = P706SPEC and PDPORD = #value#
order by P706LINE
 


 I am having issues when the data returned by SQL statement has special
characters like > or umlots ü,
 how do i handle this, is there a way to tell ibatis to parse these special
characters and make it XML complaint before creating XML result

 Ashish


Re: BigDecimal conversion exception wth DB2

2008-01-03 Thread j-lists
This is really just a database/jdbc problem, nothing to do with ibatis
itself. You probably have a precision problem relating to your
fraction (that is too small to show up in the 1.0E+18), setting the
scale on the BigDecimal before sending it to the database might sort
that out for you.

-J

On Jan 4, 2008 1:24 PM, chunnu <[EMAIL PROTECTED]> wrote:
>
> SEVERE: #{MarginRuleEntry.btnSave_action}:
> javax.faces.el.EvaluationException: com.ibatis.dao.client.DaoException:
> Failed to update - id [updateMarginRuleDetail] - parameterObject [idx :
> 3marginruleid : null  auid : 13  cpartyid : 0  initmargin : 1.0E+18  margin
> : 99  granularity : null  exid : null entryid : admin modidx
> : nullauuserid : null acronym : null  indate : 2008-01-04 10:31:59.406002
> efdate : 2008-01-04 10:31:59.406002  exdate : null].  Cause:
> com.ibatis.common.jdbc.exception.NestedSQLException:
> --- The error occurred in Common/reference/MarginRuleDetailSqlMap.xml.
> --- The error occurred while applying a parameter map.
> --- Check the updateMarginRuleDetail-InlineParameterMap.
> --- Check the statement (update failed).
> --- Cause: com.ibm.db2.jcc.b.SqlException: BigDecimal conversion exception
> [ibm][db2][jcc][converters] Overflow occurred during numeric data type
> conversion of "1.0E+18".. See attached Throwable.
> Caused by: com.ibm.db2.jcc.b.SqlException: BigDecimal conversion exception
> [ibm][db2][jcc][converters] Overflow occurred during numeric data type
> conversion of "1.0E+18".. See attached Throwable.
> javax.faces.FacesException: #{MarginRuleEntry.btnSave_action}:
> javax.faces.el.EvaluationException: com.ibatis.dao.client.DaoException:
> Failed to update - id [updateMarginRuleDetail] - parameterObject [idx :
> 3marginruleid : null  auid : 13  cpartyid : 0  initmargin : 1.0E+18  margin
> : 99  granularity : null  exid : null entryid : admin modidx
> : nullauuserid : null acronym : null  indate : 2008-01-04 10:31:59.406002
> efdate : 2008-01-04 10:31:59.406002  exdate : null].  Cause:
> com.ibatis.common.jdbc.exception.NestedSQLException:
> --- The error occurred in Common/reference/MarginRuleDetailSqlMap.xml.
> --- The error occurred while applying a parameter map.
> --- Check the updateMarginRuleDetail-InlineParameterMap.
> --- Check the statement (update failed).
> --- Cause: com.ibm.db2.jcc.b.SqlException: BigDecimal conversion exception
> [ibm][db2][jcc][converters] Overflow occurred during numeric data type
> conversion of "1.0E+18".. See attached Throwable.
> Caused by: com.ibm.db2.jcc.b.SqlException: BigDecimal conversion exception
> [ibm][db2][jcc][converters] Overflow occurred during numeric data type
> conversion of ":-/
>
>
>
> in databse i created a column of type decimal and size is 32,6
>
> --
> View this message in context: 
> http://www.nabble.com/BigDecimal-conversion-exception-wth-DB2-tp14611156p14611156.html
> Sent from the iBATIS - User - Java mailing list archive at Nabble.com.
>
>


Re: Query timeout (I think)

2008-01-29 Thread j-lists
> [TDS Driver]Read timed out
This looks to me like a network-level timeout, not a database timeout.
I've only used the open-source jdbc driver for SQL Server but we  have
had problems with connection instability if our app is idle for a long
time (MSSQL2005), a ping-query fixed that though. Doesn't seem like
this is your problem but it doe snot seem like actual performance is
your problem either.

-J

On Jan 24, 2008 7:00 PM, charlie bird <[EMAIL PROTECTED]> wrote:
> Hi - Hope someone can help.
>
> I am using ibatis 2.3.0.667 within Spring 2.0 on
> Tomcat 5.5.9A connecting to SQL Server 7 and Merlia
> SQL server driver and getting this stack trace:
>
> 2008-01-24 10:45:49,276 DEBUG [java.sql.Connection] -
> <{conn-100027} Connection>
> 2008-01-24 10:45:49,292 DEBUG [java.sql.Connection] -
> <{conn-100027} Preparing Statement:select
> s.SearchID, s.FieldID, s.UserID, s.SearchType,
> s.timestamp, convert(datetime, convert(varchar,
> s.Timestamp, 104), 104) as thedate, s.Thesaurus,
> s.UserSaved,   s.SuccessfulSearch, s.FieldValue,
> f.FieldName, f.methodName  from
> EU_Users_Saved_Searches sinner join
> wf_Prospectus_Fields f  on s.FieldId = f.ID  inner
> join (   select top 10 s.SearchID , max(s.Timestamp)
> as timestamp from EU_Users_Saved_Searches s where
> s.UserID = ?and s.SearchType = ?
> group by s.SearchID   order by max(s.Timestamp)  desc
>  ) as sub1   on s.SearchID = sub1.SearchID  order by
> s.Timestamp  desc   >
> 2008-01-24 10:45:49,292 DEBUG
> [java.sql.PreparedStatement] - <{pstm-100028}
> Executing Statement:select s.SearchID, s.FieldID,
> s.UserID, s.SearchType, s.timestamp, convert(datetime,
> convert(varchar, s.Timestamp, 104), 104) as thedate,
> s.Thesaurus, s.UserSaved,   s.SuccessfulSearch,
> s.FieldValue, f.FieldName, f.methodName  from
> EU_Users_Saved_Searches sinner join
> wf_Prospectus_Fields f  on s.FieldId = f.ID  inner
> join (   select top 10 s.SearchID , max(s.Timestamp)
> as timestamp from EU_Users_Saved_Searches s where
> s.UserID = ?and s.SearchType = ?
> group by s.SearchID   order by max(s.Timestamp)  desc
>  ) as sub1   on s.SearchID = sub1.SearchID  order by
> s.Timestamp  desc   >
> 2008-01-24 10:45:49,292 DEBUG
> [java.sql.PreparedStatement] - <{pstm-100028}
> Parameters: [4163, 1]>
> 2008-01-24 10:45:49,292 DEBUG
> [java.sql.PreparedStatement] - <{pstm-100028} Types:
> [java.lang.Integer, java.lang.Integer]>
> 2008-01-24 10:46:09,870 INFO
> [org.springframework.beans.factory.xml.XmlBeanDefinitionReader]
> -  resource
> [org/springframework/jdbc/support/sql-error-codes.xml]>
> 2008-01-24 10:46:09,917 INFO
> [org.springframework.jdbc.support.SQLErrorCodesFactory]
> -  Informix, MS-SQL, MySQL, Oracle, PostgreSQL, Sybase]>
> org.springframework.jdbc.UncategorizedSQLException:
> SqlMapClient operation; uncategorized SQLException for
> SQL []; SQL state [S1T00]; error code [0];
> --- The error occurred while applying a parameter map.
>
> --- Check the
> EU_Users_Saved_Searches.getSearchesByUser-InlineParameterMap.
>
> --- Check the statement (query failed).
> --- Cause: java.sql.SQLException: [TDS Driver]Read
> timed out; nested exception is
> com.ibatis.common.jdbc.exception.NestedSQLException:
>
> --- The error occurred while applying a parameter map.
>
> --- Check the
> EU_Users_Saved_Searches.getSearchesByUser-InlineParameterMap.
>
> --- Check the statement (query failed).
> --- Cause: java.sql.SQLException: [TDS Driver]Read
> timed out
> Caused by:
> com.ibatis.common.jdbc.exception.NestedSQLException:
>
> --- The error occurred while applying a parameter map.
>
> --- Check the
> EU_Users_Saved_Searches.getSearchesByUser-InlineParameterMap.
>
> --- Check the statement (query failed).
> --- Cause: java.sql.SQLException: [TDS Driver]Read
> timed out
> at
> com.ibatis.sqlmap.engine.mapping.statement.GeneralStatement.executeQueryWithCallback(GeneralStatement.java:185)
> at
> com.ibatis.sqlmap.engine.mapping.statement.GeneralStatement.executeQueryForList(GeneralStatement.java:123)
> at
> com.ibatis.sqlmap.engine.impl.SqlMapExecutorDelegate.queryForList(SqlMapExecutorDelegate.java:615)
> at
> com.ibatis.sqlmap.engine.impl.SqlMapExecutorDelegate.queryForList(SqlMapExecutorDelegate.java:589)
> at
> com.ibatis.sqlmap.engine.impl.SqlMapSessionImpl.queryForList(SqlMapSessionImpl.java:118)
> at
> org.springframework.orm.ibatis.SqlMapClientTemplate$3.doInSqlMapClient(SqlMapClientTemplate.java:268)
> at
> org.springframework.orm.ibatis.SqlMapClientTemplate.execute(SqlMapClientTemplate.java:193)
> at
> org.springframework.orm.ibatis.SqlMapClientTemplate.executeWithListResult(SqlMapClientTemplate.java:219)
> at
> org.springframework.orm.ibatis.SqlMapClientTemplate.queryForList(SqlMapClientTemplate.java:266)
> at
> com.globalfilings.domain.dao.SavedSearchDAOImpl.getUserSearches(SavedSearchDAOImpl.java:128)
> at
> com.globalfilings.services.Us

Re: Data type mismatch with queryForObject, on String property with String value!

2008-02-19 Thread j-lists
I have encountered something similar to this before and I think there
were 2 elements to the solution. The first was that the system default
CCSID on the AS/400 was not set and I believe the second was that we
could set a jdbc driver property in the toolkit driver to override it
- or something like that. That's all I remember (beyond the fact that
IBM themselves had no answer for us, we flailed around for 4 days
before we figured it out through dumb luck).
Thankfully I don't have to work with AS/400s anymore.

On Feb 19, 2008 4:58 PM, Tracey Annison <[EMAIL PROTECTED]> wrote:
>
>
> Well, it turned out to be nothing to do with the data type setup, in the
> end...
>
> We had a similar problem with another file, and wrote code to return data in
> a different way, which unexpectedly gave us hex instead of what we expected.
> Turns out that both files had an unexpected CCSID, AKA codepage or character
> set ID. So every field in this table was returning a hex value twice the
> size we expected, thus causing all sorts of havoc!
>
> I hope we'll be able to change the CCSID on these files, but just in case we
> can't, does anyone know how to configure Ibatis to expect a particular CCSID
> on a given table? Googling isn't giving me anything...
>
> Cheer
> Tracey Annison
>
>
>
>  
>  From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]
> Sent: 15 February 2008 15:37
> To: user-java@ibatis.apache.org
> Subject: Re: Data type mismatch with queryForObject, on String property with
> String value!
>
>
>
>
> If I  remember correctly we had the same problem in the past.
> The error actually occured with the BigDecimal parameter but was reported to
> happen elsewhere.
> Try #departmentCode:DECIMAL# and see if it helps.
>
> Cheers
> Marc Heimann
> Software Engineer
>
> Prolifics Deutschland GmbH
> Notkestr. 3, D-22607 Hamburg
> phone +49 (0)40 890 667-70
> fax+49 (0)40 890 667-99
> [EMAIL PROTECTED]
> 2007 IBM Award Winner for Overall Technical Excellence
> SOA... Building Future Business Solutions Today
>
> Handelsregister: Hamburg, HRB 89903
> Geschäftsführer: Ulrich Frotscher
>
>
> "Tracey Annison" <[EMAIL PROTECTED]> wrote on 15.02.2008 16:25:38:
>
> > Hiya
> > We've been using ibatis with Java for ages, agaionst dtaabases on an
> > AS/400, and have a standard way of coding that works fine for loads
> > of files. But now I have some weird behaviour that I don't understand…
> >
>
> > I have a TransactionCode.xml with a query in it like this :
> >  > parameterClass="java.util.HashMap"
> > resultClass="java.lang.Integer">
> > 
> > 
> >
>
> > We're using that to see if there is a file entry :
> > public Boolean isTransactionCodeExtant(final String library,
> > final BigDecimal companyCode, final BigDecimal departmentCode,
> > final String transactionCode, final SqlMapClient sqlMapClient)
> > throws DAOException {
> > Map parameters = new HashMap();
> > parameters.put("library", library);
> > parameters.put("companyCode", companyCode);
> > parameters.put("departmentCode", departmentCode);
> > parameters.put("transactionCodename", transactionCode);
> > this.logger.debug("getTransactionCodesCount On parameters >
> > "+parameters.toString());
> > Object result;
> > Integer occurrences;
> > try {
> > this.logger
> > .debug("getting Number of occurrences with
> > transactionCode >" + transactionCode +"<");
> > result = sqlMapClient.queryForObject(
> > "getTransactionCodesCount", parameters);
> > this.logger.debug("result = >" + String.valueOf(result));
> > occurrences = (Integer) result;
> > this.logger.debug("Number of occurrences = >" +
> > String.valueOf(occurrences));
> > if ((occurrences == null) || (occurrences == 0)) {
> > return Boolean.FALSE;
> > }
> > } catch (SQLException exception) {
> > this.logger.debug("Ibatis DAO Exception", exception);
> > throw new DAOException(IbatisExceptionMessageConverter
> > .extractUserExceptionMessage(exception));
> > }
> > return Boolean.TRUE;
> > }
> >
>
> > I'm pasing it a String of "NCBONGTA" for library, BigDecimals
> > holding 1 for companyCode and departmentCode, and a String of "PRM"
> > for transactionCodename. I'm expecting to see a SQL statement in my
> > log, and for it to come back with a sensible reply, just like it
> > does on every other file, but instead I get a log like this :
> >
> > DEBUG 15-Feb-2008/14:30:13,196
> > uk.co.x.TransactionCodeIbatisDAO.isTransactionCodeExtant():181 -
> > getTransactionCodesCount On parameters > {transactionCodename=PRM,
> > companyCode=1, library=NCBONGTA, departm

Re: Data type mismatch with queryForObject, on String property with String value!

2008-02-19 Thread j-lists
If you can't fix the CCSID on the targets then maybe a long or
BigInteger with the encoding of the string into the bytes that it
would be represented by in the target CCSID would do the job? It would
be a hack but I assume if you are on an AS/400 you aren't doing
greenfield development - if someone more important than you (or
impossible to change) needs the different CCSID I'm guessing your
stuck with it.
You should be able to solve any problem with results with a type handler.

On Feb 20, 2008 4:06 AM, Jeff Butler <[EMAIL PROTECTED]> wrote:
> This is a driver property - AFAIK it can't be configured per table.
> Probably the best thing to do is to fix the CCSID on the problem tables on
> the AS/400 side.
>
> Jeff Butler
>
>
>
> On Feb 19, 2008 3:42 AM, Tracey Annison <[EMAIL PROTECTED]> wrote:
>
> > Heya
> >
> > Thanks for that! It could be a problem for me setting it on the JDBC
> driver, though, as this is   perfectly OK for most of the AS/400 files -
> there's just a couple that have this different CCSID. Looks like I'd ned to
> configure it in iBatis, per file, which I don't see any info about so far...
> >
> > Cheers
> > Tracey Annison
> >
> >
> >
> >
> > -Original Message-
> > From: j-lists [mailto:[EMAIL PROTECTED]
> > Sent: 19 February 2008 09:10
> > To: user-java@ibatis.apache.org
> > Subject: Re: Data type mismatch with queryForObject, on String property
> with String value!
> >
> > I have encountered something similar to this before and I think there were
> 2 elements to the solution. The first was that the system default CCSID on
> the AS/400 was not set and I believe the second was that we could set a jdbc
> driver property in the toolkit driver to override it
> > - or something like that. That's all I remember (beyond the fact that IBM
> themselves had no answer for us, we flailed around for 4 days before we
> figured it out through dumb luck).
> > Thankfully I don't have to work with AS/400s anymore.
> >
> > On Feb 19, 2008 4:58 PM, Tracey Annison <[EMAIL PROTECTED]> wrote:
> > >
> > >
> > > Well, it turned out to be nothing to do with the data type setup, in
> > > the end...
> > >
> > > We had a similar problem with another file, and wrote code to return
> > > data in a different way, which unexpectedly gave us hex instead of what
> we expected.
> > > Turns out that both files had an unexpected CCSID, AKA codepage or
> > > character set ID. So every field in this table was returning a hex
> > > value twice the size we expected, thus causing all sorts of havoc!
> > >
> > > I hope we'll be able to change the CCSID on these files, but just in
> > > case we can't, does anyone know how to configure Ibatis to expect a
> > > particular CCSID on a given table? Googling isn't giving me anything...
> > >
> > > Cheer
> > > Tracey Annison
> > >
> > >
> > >
> > >  
> > >  From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]
> > > Sent: 15 February 2008 15:37
> > > To: user-java@ibatis.apache.org
> > > Subject: Re: Data type mismatch with queryForObject, on String
> > > property with String value!
> > >
> > >
> > >
> > >
> > > If I  remember correctly we had the same problem in the past.
> > > The error actually occured with the BigDecimal parameter but was
> > > reported to happen elsewhere.
> > > Try #departmentCode:DECIMAL# and see if it helps.
> > >
> > > Cheers
> > > Marc Heimann
> > > Software Engineer
> > >
> > > Prolifics Deutschland GmbH
> > > Notkestr. 3, D-22607 Hamburg
> > > phone +49 (0)40 890 667-70
> > > fax+49 (0)40 890 667-99
> > > [EMAIL PROTECTED]
> > > 2007 IBM Award Winner for Overall Technical Excellence SOA... Building
> > > Future Business Solutions Today
> > >
> > > Handelsregister: Hamburg, HRB 89903
> > > Geschäftsführer: Ulrich Frotscher
> > >
> > >
> > > "Tracey Annison" <[EMAIL PROTECTED]> wrote on 15.02.2008
> 16:25:38:
> > >
> > > > Hiya
> > > > We've been using ibatis with Java for ages, agaionst dtaabases on an
> > > > AS/400, and have a standard way of coding that works fine for loads
> > > > of files. But now I have some weird behaviour that I don't
> > > > understand...
> > > >
> > >

Re: how can i delete a thread created by me on this forum.

2008-02-19 Thread j-lists
Let me guess, your boss at Sungard is unhappy that you posted
information about their proprietary data structures to this list?
The bad news is that it is pretty much impossible to remove a message
from this "forum" because it is actually a mailing list - there are
probably hundreds of copies of it on servers all over the world by
now.
The good news is that the information you posted is probably not very valuable.
The worst news is that the people asking you to remove it think it is
very valuable anyway and you are unlikely to change their minds.



On Feb 20, 2008 2:55 PM, Yuvraj Shinde <[EMAIL PROTECTED]> wrote:
>
>
>
>
>
>
> Hi all,
>
>
>
>  Can any body please tell me? How I can delete a Thread / Edit a Thread from
> ibatis forum.
>
>
>
> Regards
>
> yuvraj
>
>  
>
>
> From: Yuvraj Shinde [mailto:[EMAIL PROTECTED]
>  Sent: Wednesday, February 20, 2008 12:01 PM
>  To: user-java@ibatis.apache.org
>  Subject: how can i delete a thread created by me on this forum.
>
>
>
>
>
>
>
>
>
>


Re: Need help with query metadata caching (remapResults)

2008-02-24 Thread j-lists
We dump our references to the original SQLMapClient instance and
replace it with a new one (we don't allow anyone to reference it
directly in application code to make sure we don't have any leaks) but
we don't use Spring so I'm not sure how that might restrict your
options.

On Fri, Feb 22, 2008 at 10:19 PM, Larry Meadors <[EMAIL PROTECTED]> wrote:
> I haven't tried this myself, but there must be a way to reinitialize
>  the SqlMapClient - that would do it.
>
>  Larry
>
>
>
>
>  On Fri, Feb 22, 2008 at 3:03 AM, Davide Rogora
>  <[EMAIL PROTECTED]> wrote:
>  > Hi,
>  >  we have the following problem with iBatis.
>  >
>  >  Our application (web application using spring), in some cases does an
>  >  automatic upgrade of the database (add and drop colums on varous tables);
>  >  after this upgrade we have problems with iBatis, because iBatis by default
>  >  remembers what fields were returned the first time a query was run (so 
> i.e.
>  >  if we add a new column, the value of this new column is not returned by
>  >  iBabtis).
>  >
>  >  We've found two ways to solve this problem (but we don't like none of 
> them):
>  >  1) Restart the web application (but this solution is not applicable in our
>  >  case).
>  >  2) Set the remapResults attribute to "true" for each query (but it slows 
> the
>  >  application).
>  >
>  >  So, I'm asking you if there is a way, after our automatic db upgrade, to
>  >  tell iBatis to discard all the "cached" resultset metadata (so, the first
>  >  next time the query will be executed, iBatis will determine the correct
>  >  columns returned by the query).
>  >  Another solution could be to find a way to restart completely iBatis 
> engine
>  >  without restarting the web application.
>  >
>  >  Is there a way to achieve one of these two hypothetic solutions?
>  >
>  >  Thanks,
>  >  Davide.
>  >
>  >
>  >
>  >
>


Re: about bean with no GET method performance

2008-04-04 Thread j-lists
I think the real news here is that alibaba.com is using ibatis! I did
a quick search and found this:
http://code.google.com/p/ibatis-sharding/
It looks like it is a project from the devs at alibaba.

-J


Re: [OT] Execute multiple statements in MySQL

2005-09-22 Thread j-lists
I guess this is a bit of a digression but since we are on the topic...
IMHO finding multiple statements using semicolons would be less than
ideal, allowing the nesting of insert/update/delete/select tags would
be a more structured way to implement it and would remove the SQL
parsing burden from iBatis (eliminates the need for an escape sequence
as well). Nesting/chaining tags to execute a sequence of SQL, if the
semamantics are carefully designed, could be a very powerful feature.

-JOn 9/12/05, Clinton Begin <[EMAIL PROTECTED]> wrote:

Such a feature wouldn't even have to be vendor specific. It could
simply be a flag like EnableMultipleStatements="true", which would tell
iBATIS to look for semicolons and execute mutiple statements.

I don't think the nature of iBATIS is such that it will never have
"vendor specific" features so to speak.  No moreso than JDBC does
anyway...

Cheers,
Clinton
On 9/11/05, Patrick Lightbody <[EMAIL PROTECTED]
> wrote:





I too disagree. Maybe after iBatis has official support for 
recognizing the vendor (and is able to execute statements that are 
vendor-specific), we could also add support for multiple statements, even under 
MySQL. It'd be a hack, but it could just break up the statement and execute it 
serially.
 
_Patrick 
LightbodyProfessional ServicesJive Software

[EMAIL PROTECTED]www.jivesoftware.com

317 SW Alder, Ste 
500Portland, OR 97204ph (503) 295-6552fx (503) 
961-1047 
 


From: [EMAIL PROTECTED] 
[mailto:[EMAIL PROTECTED]] On Behalf Of Clinton 
BeginSent: Sunday, September 11, 2005 11:35 AMTo: 
user-java@ibatis.apache.orgSubject: Re: [OT] Execute multiple 
statements in MySQL
I think MySQL considers it a security issue (SQL injection), so I 
don't believe there is a way.FWIW, I disagree with them on 
thatClinton
On 9/11/05, Barnett, 
Brian W. <[EMAIL PROTECTED]> 
wrote:
Anybody 
  here know how to configure a MySQL JDBC datasource to allow 
  multiplestatements, separated by semi-colons, to 
  execute?TIA,Brian 
  Barnett 
  This email may contain confidential material.If you were not an 
  intended recipient,Please notify the sender and delete all copies.We 
  may monitor email to and from our 
  network. 
  






Re: Property starting with 'i' character in Turkish Locale

2005-11-06 Thread j-lists
I have no idea why this is happening to you but I suggest that this article might offer some insight:
http://cafe.elharo.com/java/turkish/

-J
On 11/5/05, Bahri Gencsoy <[EMAIL PROTECTED]> wrote:















 

Think about the most simple database table, just containing ID column
as an integer:





 







CREATE TABLE SAMPLE(ID INTEGER NOT NULL PRIMARY KEY)







 





And very simple mapping configuration, as stated in the tutorial:





 









PUBLIC "-//iBATIS.com//DTD SQL Map 2.0//EN"
" http://www.ibatis.com/dtd/sql-map-2.dtd
">


SELECT
ID as id
WHERE ID = #value#









 





And 'Sample' bean with
"getId()"
and "setId(int
i)" methods. 





 





All the other configurations are handled as needed. The problem is, the
returned object's "id" property is never set in Turkish locale! It is
easy to regenerate:





 







Locale.setDefault(new Locale("tr")); //if
you change this with "en", it works!





Sample sample = (Sample) map.queryForObject("getSample",
new Integer(3));
System.out.println(sample.getId()); //0 value, instead of 3







 





It just works fine if you change locale to "en", but not
acceptable for me!!! And I don't want to change & switchback locale
everytime.





 





'i' is a special character in Turkish, unlike the other latin
languages, capital 'i' is 'İ' for Turkish, not 'I'. (I am not sure if you will
see the difference in the mail, 'I' with a dot above it-can not remember the
technical name). I tried to track the problem for 2 hours, but little success.
I think the problem is in mapping from XML to property names, since I have seen
that (while debugging) reflection for bean gives correct property names (in
com.ibatis.common.beans.ClassInfo class's addMethods() method).





 





I'm using hsqldb 1.8.0.1
and ibatis 2.1.5 (latest versions up to date)





 





 





Any advice?





 





Thanks in advance,





Bahri GENCSOY





 












Re: oracle hints are treated as comments

2005-11-10 Thread j-lists
iBatis does remove the line breaks and if it stops it'll break my production DB2 app!
(And I don't know what it will do to my DB2/400 version)
-J :-)On 11/10/05, Paul Benedict <[EMAIL PROTECTED]> wrote:
I believe the XML spec does not allow the double dash to appear within a body. The -- is reservedfor comments. If you're having trouble, wrap a  around your statement:
--- Guido García Bernardo <[EMAIL PROTECTED]> wrote:> Hi,
>> I'm using ibatis sql maps 2.1.5 + Oracle 8, defining the following query> statement:>> > SELECT --+RULE>id, name, email>from ...
> >> The SQL that follows the hint is interpreted as a comment. Thus I get:>> Caused by: java.sql.SQLException: ORA-00936: missing _expression_>> It works fine when I remove the hint.
> Is ibatis removing line breaks? I think this is a bug or at least an> undesired behaviour in my case. Is there any workaround or idea?>> Thank you very much,>> --> Guido García Bernardo - 
[EMAIL PROTECTED]> Tfn. +34 983 54 89 08> ITDEUSTO - Valladolid (Spain)>__Yahoo! Mail - PC Magazine Editors' Choice 2005
http://mail.yahoo.com


Re: How to not verbosely declare resultmaps?

2005-12-20 Thread j-lists
I for one regard inline parameter maps as something of a neccessary
evil (for dynamic SQL) and would NOT like to see the same thing
introduced for result maps. It is the absence of funny escape sequences
and other complications in the iBatis SQL that makes it such a pleasure
to work with. Unfortunately, if I hand my users a gun they will indeed
shoot themselves in the foot.
I believe that parsing the SQL in the statement elements is really a
Bad Thing*. I think a version of inline parameter maps that uses and
XML syntax would be great, and a good basis for a inline result map
syntax, something like:
select 
from foo f
where f.BAR = 

What I guess we really need for those who do not find joy in authoring
sqlmap files by hand is a GUI editor, then it wouldn't matter what
format the stuff was in and support for different ways of expressing
the same thing would not be needed. Perhaps the effort would be best
applied in that direction, it would keep the core smaller and the whole
community would be better for having it.

-J

* I think I also expressed this when using a ";" to separate multiple
statements in a tag was suggested, if we're going to use XML, lets use
XML and then we can genuinely program against it instead of parsing it
in a dozen funny, bug-inducing ways. And who hasn't it the
"NodeletException" when your #'s are not balanced? ..took a long time
to figure that one out the first time it happened. At my office we've
got code that parses and generates sqlmap xml files to get query and
update metadata for the application, the more info that is in real XML
the easier it is to work with.
On 12/20/05, Jozef Hribik <[EMAIL PROTECTED]> wrote:
Hi Clinton,+1 abd I would like to have one more option ;-)#COLUMN:KEY:TYPE#SELECT #p.T01_NAME:name:String#, #p.T01_AGE:age:Integer#
  FROM T01_PERSON pCheersJozefClinton Begin wrote:>> I would love to add inline result map support.  :-)>> Unfortunately you and I are the minority.  But that doesn't mean we
> cannot do it.  So, my question to you is:  how would you like to see> the syntax?>> Here are some options:>> $NAME:VARCHAR$> !NAME:VARCHAR!> @NAME:VARCHAR@> "NAME:VARCHAR"
> |NAME:VARCHAR|   << I like the pipes, but does anyone know of any> potential issues with using it?>> In hindsight, I wish I had used @@ for inline parameters and ## for> inline result maps (because it looks like a little row set!).
>> Cheers,> Clinton On 12/19/05, *Yusuf* <[EMAIL PROTECTED]> [EMAIL PROTECTED]
>> wrote:>> Dear All,> I've been using ibatis for about 1 year now, and i'm very> satisfied with> it!> I wanted to ask if i can do this:>> > SELECT name, age, address, income>   FROM person> >> but I wanted the default datatype for NAME is String, AGE is
> Integer, and INCOME is Double, not the default BigDecimal..> without specifying resultMaps or resultClasses (because i have so> many> queries like this and it would be very verbose to declare them one by
> one)>> I know we can declare something like this in insert statements like>> > INSERT INTO person (name, age) VALUES (#name:VARCHAR:-#,
> #age:NUMBER:0#)> >> but can it be done in select statements to in ibatis? for example like> this maybe:>> > SELECT name:String, age:Integer, address:String, income:Double>   FROM person> >> Thank you...>>



Re: Pattern for multiple database

2006-03-29 Thread j-lists
A clever use of  and  where the  is in the ${dialect} file will
give some pretty reasonable flexability without the need to exploit any
bugs. I have recently posted a JIRA feature request precisely to help
address key generation aspect of the cross-DB compatability issue more
easily using properties instead or replacing entire statements:
http://issues.apache.org/jira/browse/IBATIS-277

-J

PS: I was pleased to have another closely related issue was addressed in record time:
http://issues.apache.org/jira/browse/IBATIS-195

Thanks Clinton!




Re: [VOTE] Release iBATIS 2.3

2006-11-21 Thread j-lists

Does this mean 2.2 will never be a GA release or that it already is?

On 11/21/06, Clinton Begin <[EMAIL PROTECTED]> wrote:

Hi all,

I'd like to release iBATIS 2.3 sometime this week.  The changes listed for
the release are as follows:

 o DEPRECATED All PaginatedList related features due to misuse, minimal
applicability and inflexibility
 o DEPRECATED DAO Framework -- Removed from primary distribution, available
as a separate download
 o Removed DAO framework from Subversion source tree (tagged before removal)
 o Changed deployment file naming convention, dropped "DBL" and lowercased
all
 o Merged common and sqlmap jar files (no more DAO means there's no point in
keeping commons separate)
 o Implemented transaction level PreparedStatement caching
 o Fixed IBATIS-335 - Don't call setQueryTimeout if no value specified
 o Fixed IBATIS-353 - Probe exception when using inheritance hierarchies

Cheers,
Clinton