[jira] Closed: (IBATIS-263) Ignore case on type aliases

2006-02-22 Thread Nathan Maves (JIRA)
 [ http://issues.apache.org/jira/browse/IBATIS-263?page=all ]
 
Nathan Maves closed IBATIS-263:
---


Meant to close this issue.

> Ignore case on type aliases
> ---
>
>  Key: IBATIS-263
>  URL: http://issues.apache.org/jira/browse/IBATIS-263
>  Project: iBatis for Java
> Type: Improvement
>   Components: SQL Maps
> Versions: 2.1.7
> Reporter: Nathan Maves
> Assignee: Nathan Maves
> Priority: Trivial
>  Fix For: 2.2.0

>
> All of the following, "String", "string", and "StRiNg", should resolve to 
> java.lang.String.

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
   http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see:
   http://www.atlassian.com/software/jira



[jira] Closed: (IBATIS-261) CLONE -The method executor.executeBatch() always returns 0.

2006-02-22 Thread Sven Boden (JIRA)
 [ http://issues.apache.org/jira/browse/IBATIS-261?page=all ]
 
Sven Boden closed IBATIS-261:
-

Fix Version: 2.2.0
 Resolution: Invalid
  Assign To: Sven Boden

This is not a bug in iBATIS, so I'm closing the JIRA. I would suggest to use 
the dev mailing list for further discussion... if required.

I made small testcase with Oracle to simulate the problem, the easiest for you 
would be to put a breakpoint on the method executeBatch() in SqlExecutor and 
step through that method (and also going into batch.executeBatch()).
What you will detect in there is that the updates/inserts get executed properly 
but the return array of ints of executeBatch will contain all -2's, which get 
translated to 0 and added up... so you will always get 0 back upon successful 
execution.

The reason is Oracle (not the JDBC drivers, Oracle). From the Oracle manuals: 
"For a prepared statement batch, it is not possible to know the number of rows 
affected in the database by each individual statement in the batch. Therefore, 
all array elements have a value of -2. According to the JDBC 2.0 specification, 
a value of -2 indicates that the operation was successful but the number of 
rows affected is unknown.", hence your problem with the row count.

Oracle has decided not to support the row count in a batch for 
PreparedStatements. iBATIS uses PreparedStatements, even if you use all $$ 
notation (PreparedStatement without parameters) and that's why you get a 0 row 
count. The JDBC spec leaves it open, Oracle took the easy way out in this case, 
HSQL implemented it.

Just on a side note:
- Oracle also does not support batch processing for non-PreparedStatements (you 
can put them in a batch, but they are sent 1 by 1 to the database server 
without batching).
- You do need PreparedStatements with properly binded arguments for Oracle 
unless you want to experience severe performance and scalability problems.

Sven



> CLONE -The method executor.executeBatch() always returns 0.
> ---
>
>  Key: IBATIS-261
>  URL: http://issues.apache.org/jira/browse/IBATIS-261
>  Project: iBatis for Java
> Type: Bug
>   Components: SQL Maps
> Versions: 2.1.0
>  Environment: SUN JVM 1.4.2 On Windows
> Reporter: Arne Burmeister
> Assignee: Sven Boden
>  Fix For: 2.2.0

>
> I am using Sql Maps 2.1.5 with Spring 1.2.4.
> I have a method as following. 
> I want to get the number of rows updated in the batch . 
> But it always returns 0. 
> public int insertBatchError(final List batchErrorList) { 
> Integer count = (Integer) getSqlMapClientTemplate().execute(new 
> SqlMapClientCallback() { 
> public Object doInSqlMapClient(SqlMapExecutor executor) throws 
> SQLException { 
>  executor.startBatch(); 
> for (int i = 0; i < batchErrorList.size(); i++) { 
>  BatchErrorDTO batchErrorDto = (BatchErrorDTO) 
> batchErrorList.get(i); 
> executor.update("insertBatchError", batchErrorDto); 
> } 
> int count = executor.executeBatch(); 
> return new Integer(count); 
> } 
> }); 
>  
> return count.intValue(); 
> }

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
   http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see:
   http://www.atlassian.com/software/jira



[jira] Commented: (IBATISNET-140) procedure output parameters do work for oracle provider

2006-02-22 Thread Gilles Bayon (JIRA)
[ 
http://issues.apache.org/jira/browse/IBATISNET-140?page=comments#action_12367372
 ] 

Gilles Bayon commented on IBATISNET-140:


In the unit tests, the swap procedure (prc_SWAP_EMAIL_ADDRESS) has been runned 
with success

prc_Swap_Email_Address

see TestProcedureWithOutputParameters in 
IBatisNet.DataMapper.Test.NUnit.SqlMapTests.Oracle.ProcedureTest.cs

> procedure output parameters do work for oracle provider
> ---
>
>  Key: IBATISNET-140
>  URL: http://issues.apache.org/jira/browse/IBATISNET-140
>  Project: iBatis for .NET
> Type: Bug
>   Components: DataAccess
> Versions: DataAccess 1.7
>  Environment: windows xp vs .NET C#, Oracle ODP.NET for 10g
> Reporter: henry lu

>
> I tried email swap example and the result with two emails not swaped.
> I have my code:
> create or replace procedure
> ps_swap_email_address (inout_email_1 in out varchar2, inout_email_2 in out 
> varchar2)
> is
> tmp_e varchar2(120);
> begin
> tmp_e := inout_email_1;
> inout_email_1 := inout_email_2;
> inout_email_2 := tmp_e;
> end;
> /
> 
> 
> 
> 
> 
> call ps_swap_email_address(?,?)
> 
>   string first = "[EMAIL PROTECTED]";
>   string second = "[EMAIL PROTECTED]";
>   Hashtable map = new Hashtable();
>   map.Add("email_1", first);
>   map.Add("email_2", second);
>   sqlMapper.QueryForObject("call_ps_swap_email_address", map);
>   Console.WriteLine("1="+map["email_1"].ToString());
>   Console.WriteLine("2="+map["email_2"].ToString());
> But the results didn't swap the email values.
> If I change the sqlmap.xml file to:
> 
>  />
>  />
> 
> I go the following errors:
> Object reference not set to an instance of an object.
>  at IBatisNet.DataMapper.MappedStatements.MappedStatement.RetrieveOutputParame
> ters(RequestScope request, IDalSession session, IDbCommand command, Object 
> resul
> t)
>  at IBatisNet.DataMapper.MappedStatements.MappedStatement.RunQueryForObject(Re
> questScope request, IDalSession session, Object parameterObject, Object 
> resultOb
> ject)
>  at IBatisNet.DataMapper.MappedStatements.MappedStatement.ExecuteQueryForObjec
> t(IDalSession session, Object parameterObject, Object resultObject)
>  at IBatisNet.DataMapper.MappedStatements.MappedStatement.ExecuteQueryForObjec
> t(IDalSession session, Object parameterObject)
>  at IBatisNet.DataMapper.SqlMapper.QueryForObject(String statementName, Object
> parameterObject)
> -Henry

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
   http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see:
   http://www.atlassian.com/software/jira



[jira] Closed: (IBATIS-266) when a roll back occurs in stored procedure. The status is not being handled by IBATIS causing it to crash.

2006-02-22 Thread Sven Boden (JIRA)
 [ http://issues.apache.org/jira/browse/IBATIS-266?page=all ]
 
Sven Boden closed IBATIS-266:
-

Resolution: Invalid

Closed as not a problem in iBATIS.


>  when a roll back occurs in stored procedure. The status is not being handled 
> by IBATIS causing it to crash.
> 
>
>  Key: IBATIS-266
>  URL: http://issues.apache.org/jira/browse/IBATIS-266
>  Project: iBatis for Java
> Type: Bug
> Versions: 2.1.5
>  Environment: Websphere Studio Application Developer running on Windows XP . 
> Stored procedure being called is  in  DB2.
> Reporter: Mohamed Asad

>
> IBATIS does not handle SP Status returned back from the Stored procedure when 
> a roll back is occured
> The rollback command is in the StoredProcedure  and not in the Java Code.  
> When the Stored procedure
> is rolled back in DB2 .  The iBATIS code just crashes.  
> I tried calling the Same SP from websphere tool and it did recieve a 
> SPStatus.   

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
   http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see:
   http://www.atlassian.com/software/jira



[jira] Commented: (IBATIS-266) when a roll back occurs in stored procedure. The status is not being handled by IBATIS causing it to crash.

2006-02-22 Thread Mohamed Asad (JIRA)
[ 
http://issues.apache.org/jira/browse/IBATIS-266?page=comments#action_12367362 ] 

Mohamed Asad commented on IBATIS-266:
-

After few more research on the problem . IBATIS does handle the SPStatus but 
the reason of crash was because the Stored procedure has
multiple out parameters. Because of the rollback the out parameters are set to 
null. and this is crashing the server. I got around this problem 
by setting default values in Stored procedure for out paremeter during a 
rollback.  In this case I get the SP Status back with the error value. 





>  when a roll back occurs in stored procedure. The status is not being handled 
> by IBATIS causing it to crash.
> 
>
>  Key: IBATIS-266
>  URL: http://issues.apache.org/jira/browse/IBATIS-266
>  Project: iBatis for Java
> Type: Bug
> Versions: 2.1.5
>  Environment: Websphere Studio Application Developer running on Windows XP . 
> Stored procedure being called is  in  DB2.
> Reporter: Mohamed Asad

>
> IBATIS does not handle SP Status returned back from the Stored procedure when 
> a roll back is occured
> The rollback command is in the StoredProcedure  and not in the Java Code.  
> When the Stored procedure
> is rolled back in DB2 .  The iBATIS code just crashes.  
> I tried calling the Same SP from websphere tool and it did recieve a 
> SPStatus.   

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
   http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see:
   http://www.atlassian.com/software/jira



[jira] Created: (IBATISNET-140) procedure output parameters do work for oracle provider

2006-02-22 Thread henry lu (JIRA)
procedure output parameters do work for oracle provider
---

 Key: IBATISNET-140
 URL: http://issues.apache.org/jira/browse/IBATISNET-140
 Project: iBatis for .NET
Type: Bug
  Components: DataAccess  
Versions: DataAccess 1.7
 Environment: windows xp vs .NET C#, Oracle ODP.NET for 10g
Reporter: henry lu


I tried email swap example and the result with two emails not swaped.

I have my code:

create or replace procedure
ps_swap_email_address (inout_email_1 in out varchar2, inout_email_2 in out 
varchar2)
is
tmp_e varchar2(120);
begin
tmp_e := inout_email_1;
inout_email_1 := inout_email_2;
inout_email_2 := tmp_e;
end;
/







call ps_swap_email_address(?,?)


  string first = "[EMAIL PROTECTED]";
  string second = "[EMAIL PROTECTED]";

  Hashtable map = new Hashtable();
  map.Add("email_1", first);
  map.Add("email_2", second);

  sqlMapper.QueryForObject("call_ps_swap_email_address", map);

  Console.WriteLine("1="+map["email_1"].ToString());
  Console.WriteLine("2="+map["email_2"].ToString());

But the results didn't swap the email values.

If I change the sqlmap.xml file to:






I go the following errors:

Object reference not set to an instance of an object.
 at IBatisNet.DataMapper.MappedStatements.MappedStatement.RetrieveOutputParame
ters(RequestScope request, IDalSession session, IDbCommand command, Object resul
t)
 at IBatisNet.DataMapper.MappedStatements.MappedStatement.RunQueryForObject(Re
questScope request, IDalSession session, Object parameterObject, Object resultOb
ject)
 at IBatisNet.DataMapper.MappedStatements.MappedStatement.ExecuteQueryForObjec
t(IDalSession session, Object parameterObject, Object resultObject)
 at IBatisNet.DataMapper.MappedStatements.MappedStatement.ExecuteQueryForObjec
t(IDalSession session, Object parameterObject)
 at IBatisNet.DataMapper.SqlMapper.QueryForObject(String statementName, Object
parameterObject)


-Henry


-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
   http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see:
   http://www.atlassian.com/software/jira