Invalid Column Type issue in confluence
Hi, In the faq page about null value inserts in here: http://opensource.atlassian.com/confluence/oss/display/IBATIS/What+cause s+an+Invalid+column+type+error+with+Oracle said that you can do something like this and you can prevent the misleading error 'Invalid Column Type' if the value in line2 and sold_date is null : INSERT INTO ADDRESS ( line1, line2, city, state, postal_code, purchase_date, sold_date ) values ( #line1#, #line2:VARCHAR#, #city#, #state#, #postal_code#, #purchase_date#, #sold_date:DATE# ) But this solution never works for me (or maybe for oracle..), instead i always have to do something like : INSERT INTO ADDRESS ( line1, line2, city, state, postal_code, purchase_date, sold_date ) values ( #line1#, null, #line2#, #city#, #state#, #postal_code#, #purchase_date#, #sold_date# ) I was wondering if someone actually having the same problem with me, currently i'm using - iBATIS 2.1.5 build 582 - oracle 8.1.7 - oracle10g jdbc thin driver (ojdbc14.jar) - c3p0 0.9.0.2 Thanks :) Yusuf.
Cache
Hi, I have question on cache. There is statement: select t.lname, t.sname, t.id, t.active from sp_name t where t.pid = #pid# t.id = #normId# order by t.sname CacheModel is: When I execute public List getNormsAndNormatives(){ List result = new ArrayList(); result = normDao.getNormList(Norm.NORM_PID); //[1] result.addAll(normDao.getNormList(Norm.NORMATIVS_PID));//[2] return result; } at first time all is right, at [1] I get 3 item in list with pid = Norm.NORM_PID and at [2] 2 items with pid = Norm.NORMATIVS_PID. But then I invoke it second time, I get 5 items in a result at [1] with pid = Norm.NORM_PID and pid = Norm.NORMATIVS_PID, and also get 2 items at [2] with pid = Norm.NORMATIVS_PID. Is it because caching in iBATIS does not use object identity? I also try to use OSCache with the same result. Is there any solution for this problem? -- Thanks. mailto:[EMAIL PROTECTED]
RE: nested iteration
I created an issue about this problem. See http://issues.apache.org/jira/browse/IBATIS-281 If this is also a problem for you, please vote for it. The patch is in the issue. If you can't apply the patch yourself (or if you don't known how to apply it correctly), I can create a jar file for you including the patch. I made it only for version 2.1.7, but I believe I can correct any 2.1 versions or higher with the same code. If you want me to correct a specific version, please tell me which one you want and I will send a jar to you. Christian Poitras [EMAIL PROTECTED] From: Janet Li [mailto:[EMAIL PROTECTED] Sent: Thursday, 20 April 2006 11:52To: user-java@ibatis.apache.orgSubject: nested iteration I have a statement like this:select NVL(attr_display_value, attr_value) AS LABEL, attr_value as VALUE FROM $idList[].partition$ t WHERE zeid = #idList[].zeId# and attr_display_order = #attributeColOrder# AND t.RESULTSET_ID in (select RESULTSET_ID from $idList[].partition$ where zeid = #idList[].zeId# AND ATTR_VALUE = #attrList[].attrValue# AND ATTR_DISPLAY_ORDER = #attrList[].attrDisplayOrder#) iterate> iterate> statement> I am getting an error : Cause: com.ibatis.common.jdbc.exception.NestedSQLException: --- The error occurred while preparing the mapped statement for execution. --- Check the getAttributesFiltered. --- Check the parameter map. --- Cause: com.ibatis.common.beans.ProbeException: Error getting ordinal list from JavaBean. Cause java.lang.NumberFormatException: For input string: ""Caused by: java.lang.NumberFormatException: For input string: "" I believe it's because it cannot read the $idList[].partition$ value inside the nested interate tag. Does anyone know how to solve this problem? I need the table name value from the outer tag to be readable in the inner iterate tag. New Yahoo! Messenger with Voice. Call regular phones from your PC and save big.
Re: cacheModel - Database Down and external app flush
For the programmatic flushing... on the SqlMapClient you have a methods called flushDataCache() that either flush all caches or a named cache. For your exception: - get the last version of iBATIS from SVN, and activate debugging... logging for caching was put in there a couple of weeks ago. - if you put "Pool.PingEnabled" to false in the SqlMapConfig transactionManager section - you should also have caching enabled of course. Also be aware that caching in iBATIS does not use object identity: ResultSets are cached, not indivual objects (but the debugging should make that more clear). If you want to have advanced caching it's probably best to roll your own in the DAO layer. Regards, Sven James Johnson wrote: Thanks Sven for the quick response. I am a beginner to iBatis, so I apologize in advance if I don't know some of the answers to your questions. I'll try my best. In regards to 2), I figured that was the case by the same reasoning. I just wanted to make sure with someone who had more experience with iBatis. However, is it possible one iBatis application receive notifications from another iBatis application to flush cache? In regards to 1), the full stack trace is below. Thanks for looking at this. Also, how would I deactivate the ping query? Exception in thread "main" org.springframework.jdbc.CannotGetJdbcConnectionException: Could not get JDBC Connection; nested exception is com.mysql.jdbc.CommunicationsException: Communications link failure due to underlying exception: ** BEGIN NESTED EXCEPTION ** java.net.SocketException MESSAGE: java.net.ConnectException: Connection refused: connect STACKTRACE: java.net.SocketException: java.net.ConnectException: Connection refused: connect at com.mysql.jdbc.StandardSocketFactory.connect(StandardSocketFactory.java:156) at com.mysql.jdbc.MysqlIO.(MysqlIO.java:284) at com.mysql.jdbc.Connection.createNewIO(Connection.java:2555) at com.mysql.jdbc.Connection.(Connection.java:1485) at com.mysql.jdbc.NonRegisteringDriver.connect(NonRegisteringDriver.java:266) at org.apache.commons.dbcp.DriverConnectionFactory.createConnection(DriverConnectionFactory.java:37) at org.apache.commons.dbcp.PoolableConnectionFactory.makeObject(PoolableConnectionFactory.java:290) at org.apache.commons.pool.impl.GenericObjectPool.borrowObject(GenericObjectPool.java:771) at org.apache.commons.dbcp.PoolingDataSource.getConnection(PoolingDataSource.java:95) at org.apache.commons.dbcp.BasicDataSource.getConnection(BasicDataSource.java:540) at org.springframework.jdbc.datasource.DataSourceUtils.doGetConnection(DataSourceUtils.java:111) at org.springframework.jdbc.datasource.DataSourceUtils.getConnection(DataSourceUtils.java:77) at org.springframework.orm.ibatis.SqlMapClientTemplate.execute(SqlMapClientTemplate.java:178) at org.springframework.orm.ibatis.SqlMapClientTemplate.executeWithListResult(SqlMapClientTemplate.java:204) at org.springframework.orm.ibatis.SqlMapClientTemplate.queryForList(SqlMapClientTemplate.java:243) at data.SqlMapClientTestDao.getAll(SqlMapClientTestDao.java:25) at service.Main.run(Main.java:37) at service.Main.main(Main.java:55) ** END NESTED EXCEPTION ** Last packet sent to the server was 0 ms ago. com.mysql.jdbc.CommunicationsException: Communications link failure due to underlying exception: ** BEGIN NESTED EXCEPTION ** java.net.SocketException MESSAGE: java.net.ConnectException: Connection refused: connect STACKTRACE: java.net.SocketException: java.net.ConnectException: Connection refused: connect at com.mysql.jdbc.StandardSocketFactory.connect(StandardSocketFactory.java:156) at com.mysql.jdbc.MysqlIO.(MysqlIO.java:284) at com.mysql.jdbc.Connection.createNewIO(Connection.java:2555) at com.mysql.jdbc.Connection.(Connection.java:1485) at com.mysql.jdbc.NonRegisteringDriver.connect(NonRegisteringDriver.java:266) at org.apache.commons.dbcp.DriverConnectionFactory.createConnection(DriverConnectionFactory.java:37) at org.apache.commons.dbcp.PoolableConnectionFactory.makeObject(PoolableConnectionFactory.java:290) at org.apache.commons.pool.impl.GenericObjectPool.borrowObject(GenericObjectPool.java:771) at org.apache.commons.dbcp.PoolingDataSource.getConnection(PoolingDataSource.java:95) at org.apache.commons.dbcp.BasicDataSource.getConnection(BasicDataSource.java:540) at org.springframework.jdbc.datasource.DataSourceUtils.doGetConnection(DataSourceUtils.java:111) at org.springframework.jdbc.datasource.DataSourceUtils.getConnection(DataSourceUtils.java:77) at org.springframework.orm.ibatis.SqlMapClientTemplate.execute(SqlMapClientTemplate.java:178) at org.springframework.orm.ibatis.SqlMapClientTemplate.executeWithListResult(SqlMapC
nested iteration
I have a statement like this:select NVL(attr_display_value, attr_value) AS LABEL, attr_value as VALUE FROM $idList[].partition$ t WHERE zeid = #idList[].zeId# and attr_display_order = #attributeColOrder# AND t.RESULTSET_ID in (select RESULTSET_ID from $idList[].partition$ where zeid = #idList[].zeId# AND ATTR_VALUE = #attrList[].attrValue# AND ATTR_DISPLAY_ORDER = #attrList[].attrDisplayOrder#) iterate> iterate> statement> I am getting an error : Cause: com.ibatis.common.jdbc.exception.NestedSQLException: --- The error occurred while preparing the mapped statement for execution. --- Check the getAttributesFiltered. --- Check the parameter map. --- Cause: com.ibatis.common.beans.ProbeException: Error getting ordinal list from JavaBean. Cause java.lang.NumberFormatException: For input string: ""Caused by: java.lang.NumberFormatException: For input string: "" I believe it's because it cannot read the $idList[].partition$ value inside the nested interate tag. Does anyone know how to solve this problem? I need the table name value from the outer tag to be readable in the inner iterate tag. New Yahoo! Messenger with Voice. Call regular phones from your PC and save big.
JTA and iBatis configuration
Hi folks, I just want to make sure my basic understanding of JTA and container managed transactions is right. I''ve defined a Datasource under JBoss in an XML file. I believe since I specificed local-tx-datasource, transactions are managed by the JBoss Transaction Manager. Therefore to use iBatis I should specify my TransactionManager as EXTERNAL and use a JNDI datasource attribute with the right URL within my runtime namespace. Right? Or do I really need to use the JTA attribute to have fully managed transactions? Thanks! -aps-- "What lies behind us and what lies in front of us is of little concern to what lies within us." -Ralph Waldo Emerson