Re: auto-generated key into RDBMS that not support the auto-generated key

2006-05-29 Thread Darek Dober

Worse than that, the example provided gives you the certainty of never
getting a unique identifier. :-D


To be precise, undoubtedly you're right :):)

Darek


Re: auto-generated key into RDBMS that not support the auto-generated key

2006-05-25 Thread Darek Dober

What's more, it doesn't give you the certainty of unique identifier.

Darek


Re: Postgres - inserting null causes error - Unknown Types value

2005-09-14 Thread Darek Dober



From my perspective, it should be ok.
 
But:
WHERE     i_divers = #idDivers:Long#
 
you shouldn't update something, if you don't know 
which record you want to update (if idDivers is null :)
 
 
Have you tried this ?
 
Cheers
Darek


Re: Postgres - inserting null causes error - Unknown Types value

2005-09-14 Thread Darek Dober




There was an error in my statement.
It should be like this, of course:)
 
insert into table(column)
values (#column:INTEGER#)
 
Darek

  - Original Message - 
  From: 
  TNO 
  To: user-java@ibatis.apache.org 
  
  Sent: Wednesday, September 14, 2005 9:22 
  AM
  Subject: Re: Postgres - inserting null 
  causes error - Unknown Types value
  This is much shorter...thanks Darek ;-) Darek Dober a 
  écrit : 
  

I read somewhere in docs, that is caused 
because jdbc driver 8.xx is almost full implementation of JDBC 
Type 3, which uses prepareStatement in contrast to jdbc driver 7.4.xx, which 
does not. So you have to explicitly specify the JDBC-type as Niels 
said.
 
You don't have to create parameterMap just 
specify the type like:
 
insert into table(column)
values (#column:INTEGER)
 
which is much shorter:)
 
Darek Dober

  - 
  Original Message - 
  From: 
  TNO 
  To: 
  user-java@ibatis.apache.org 
  
  Sent: 
  Tuesday, September 13, 2005 10:18 AM
  Subject: 
  Re: Postgres - inserting null causes error - Unknown Types value
  To avoid this, I create a parameterMap for my insert and 
  update.Niels Beekman a écrit : 
  




I do not know 
PostgreSql very well, but could it be that you have to explicitly 
specify the JDBC-type, as in Oracle?

Niels





From: 
Zarar Siddiqi [mailto:[EMAIL PROTECTED]] 
Sent: dinsdag 13 
september 2005 15:15To: user-java@ibatis.apache.orgSubject: Postgres - inserting null 
causes error - Unknown Types value


I'm having a problem with 
iBatis using PostgreSql.



I have an insert statment, 
"insertEndUser" which I pass an "EndUser" object to for inserting.  
If all the properties of the EndUser object are non-null, the insert 
works fine, but if ANY of them are null, I get the following exception, 
(in this case "gender" was null).  I'm using the Spring (1.2.4) 
framework and it's SqlMapClientTemplate class to do the 
insert.



Any ideas of what might be 
wrong.  I was thinking of using a type handler to make the mapping 
from null to empty String but this seems too trivial of a problem for it 
to require extreme measures.  I'm migrating from MySql to 
PostgreSql and this was working just fine in MySql.  




Any input is 
appreciated. 





org.springframework.jdbc.BadSqlGrammarException: 
SqlMapClient operation; bad SQL grammar []; nested exception 
iscom.ibatis.common.jdbc.exception.NestedSQLException:--- The 
error occurred in com/_8020/mcc/dao/ibatis/sql/EndUserSQL.xml.--- 
The error occurred while applying a parameter map.--- Check the 
insertEndUser-InlineParameterMap.--- Check the parameter mapping for 
the 'gender' property.--- Cause: org.postgresql.util.PSQLException: 
Unknown Types 
value.com.ibatis.common.jdbc.exception.NestedSQLException:--- 
The error occurred in 
com/company/dummy/dao/ibatis/sql/EndUserSQL.xml.--- The error 
occurred while applying a parameter map.--- Check the 
insertEndUser-InlineParameterMap.--- Check the parameter mapping for 
the 'gender' property.--- Cause: org.postgresql.util.PSQLException: 
Unknown Types value.Caused by: org.postgresql.util.PSQLException: 
Unknown Types value. at 
com.ibatis.sqlmap.engine.mapping.statement.GeneralStatement.executeUpdate(GeneralStatement.java:87) at 
com.ibatis.sqlmap.engine.impl.SqlMapExecutorDelegate.insert(SqlMapExecutorDelegate.java:442)
No virus found in this incoming message.
Checked by AVG Anti-Virus.
Version: 7.0.344 / Virus Database: 267.10.23/99 - Release Date: 12/09/2005
  -- 
Il n'y a pas de mauvais langage, il n'y a que des bons programmeurs...
No virus found in this incoming message.
Checked by AVG Anti-Virus.
Version: 7.0.344 / Virus Database: 267.10.24/101 - Release Date: 13/09/2005

  -- 
Il n'y a pas de mauvais langage, il n'y a que des bons programmeurs...


Re: Postgres - inserting null causes error - Unknown Types value

2005-09-13 Thread Darek Dober



I read somewhere in docs, that is caused 
because jdbc driver 8.xx is almost full implementation of JDBC Type 3, 
which uses prepareStatement in contrast to jdbc driver 7.4.xx, which does 
not. So you have to explicitly specify the JDBC-type as Niels 
said.
 
You don't have to create parameterMap just specify 
the type like:
 
insert into table(column)
values (#column:INTEGER)
 
which is much shorter:)
 
Darek Dober

  - Original Message - 
  From: 
  TNO 
  To: user-java@ibatis.apache.org 
  
  Sent: Tuesday, September 13, 2005 10:18 
  AM
  Subject: Re: Postgres - inserting null 
  causes error - Unknown Types value
  To avoid this, I create a parameterMap for my insert and 
  update.Niels Beekman a écrit : 
  




I do not know 
PostgreSql very well, but could it be that you have to explicitly specify 
the JDBC-type, as in Oracle?

Niels





From: Zarar 
Siddiqi [mailto:[EMAIL PROTECTED]] 
Sent: dinsdag 13 september 
2005 15:15To: user-java@ibatis.apache.orgSubject: Postgres - inserting null 
causes error - Unknown Types value


I'm having a problem with iBatis 
using PostgreSql.



I have an insert statment, 
"insertEndUser" which I pass an "EndUser" object to for inserting.  If 
all the properties of the EndUser object are non-null, the insert works 
fine, but if ANY of them are null, I get the following exception, (in this 
case "gender" was null).  I'm using the Spring (1.2.4) framework and 
it's SqlMapClientTemplate class to do the 
insert.



Any ideas of what might be 
wrong.  I was thinking of using a type handler to make the mapping from 
null to empty String but this seems too trivial of a problem for it to 
require extreme measures.  I'm migrating from MySql to PostgreSql and 
this was working just fine in MySql.  




Any input is 
appreciated. 





org.springframework.jdbc.BadSqlGrammarException: 
SqlMapClient operation; bad SQL grammar []; nested exception 
iscom.ibatis.common.jdbc.exception.NestedSQLException:--- The error 
occurred in com/_8020/mcc/dao/ibatis/sql/EndUserSQL.xml.--- The error 
occurred while applying a parameter map.--- Check the 
insertEndUser-InlineParameterMap.--- Check the parameter mapping for the 
'gender' property.--- Cause: org.postgresql.util.PSQLException: Unknown 
Types value.com.ibatis.common.jdbc.exception.NestedSQLException:--- 
The error occurred in 
com/company/dummy/dao/ibatis/sql/EndUserSQL.xml.--- The error occurred 
while applying a parameter map.--- Check the 
insertEndUser-InlineParameterMap.--- Check the parameter mapping for the 
'gender' property.--- Cause: org.postgresql.util.PSQLException: Unknown 
Types value.Caused by: org.postgresql.util.PSQLException: Unknown Types 
value. at 
com.ibatis.sqlmap.engine.mapping.statement.GeneralStatement.executeUpdate(GeneralStatement.java:87) at 
com.ibatis.sqlmap.engine.impl.SqlMapExecutorDelegate.insert(SqlMapExecutorDelegate.java:442)
No virus found in this incoming message.
Checked by AVG Anti-Virus.
Version: 7.0.344 / Virus Database: 267.10.23/99 - Release Date: 12/09/2005
  -- 
Il n'y a pas de mauvais langage, il n'y a que des bons programmeurs...


Re: Trouble with oracle 10g selectKey

2005-08-05 Thread Darek Dober
Try this (insert instead of update):

return getSqlMapClientTemplate().insert("insert" +

object.getClass().getSimpleName(),object);

Darek
- Original Message - 
From: "Koka" <[EMAIL PROTECTED]>
To: 
Sent: Friday, August 05, 2005 7:32 AM
Subject: Trouble with oracle 10g selectKey


Wow, seems I'm dumb-minded today, can not make selectKey work

Following the SQL-Maps-2.pdf I have:



select services_seq.nextval as service_id from dual

insert into Services ( service_id,service_name)
values ( #service_id#,#service_name#)


and dao (I'm using spring) looks like

public class ObjectDao extends SqlMapClientDaoSupport

public int insertObject(Object object) throws DataAccessException
{
//Service service = (Service) object;
//if (service.getService_id() == 0)
//{
//service.setService_id(((Integer) //
//
getSqlMapClientTemplate().queryForObject("getServiceSeq",0)).intValue());
//}

return getSqlMapClientTemplate().update("insert" +

object.getClass().getSimpleName(),object);
}

It tries to insert '0' for service_id. However all works fine if I
uncomment those commented lines where I select sequence manually and
omit the selectKey from sql-map

Can someone indicate any direction where I should look?
TYA
Nicholoz Koka Kiknadze



Re: daoManager start/end/commit transaction problem - solved:)

2005-08-05 Thread Darek Dober



Thanks for your answer,I solved the problem
It is difficult to say, but It was very 
obvious fault:)
 
 
By the way I have one dao 
manager.
 
Problem was that, I had my code different, 
than I wrote in my post.
 
I didn't excecute endTransaction() (It was in 
my catch exception section instead of finally section), so after 
commitTransaction, transaction was still in progress.
 
I was tricked by the fact, that commit 
transaction should release all resources and locks. Database transaction was 
commited, but still locked the tables
 
Can you explain that magic. I always thought, 
that commit releases resources?
 
Anyway thanks for help
 
Best regards
Darek Dober
 
- Original Message - 

  From: 
  Clinton 
  Begin 
  To: user-java@ibatis.apache.org 
  
  Sent: Friday, August 05, 2005 1:09 
  AM
  Subject: Re: daoManager start/end/commit 
  transaction problem
  Three things:1) You should only have one DAO 
  manager, even with multiple databases.2) In my opinion, your 
  transactions should be at the service level.  Make more coarse grained 
  service methods that demarcate transactional scope.  3) Be very 
  careful with multiple start/commit/end blocks.  You should consider a 
  global transaction manager if you're working with multiple 
  databases.Cheers,Clinton
  On 8/4/05, Darek 
  Dober <[EMAIL PROTECTED]> 
  wrote:
  HiI 
use petstore as example so I have:affairService and debtorService 
which gives me method likeupdateAffair(Domain affair) and 
updateDebtor(Domain debtor)Now I want them to be executed in one 
transaction I try to do something like thisupdate() 
{...try 
{affairService.getDaoManager().startTransaction();affairService.updateAffair(affair);debtorService.updateDebtor(debtor);affairService.getDaoManager 
().commitTransaction();} catch (Exception ex) {..} finally 
{affairService.getDaoManager().endTransaction();}But after 
that operation i have some locks in database.Is this the correct 
way, or should I use start/commit/endTransaction() method at the lower 
level of  ...sqlMapDao (i.e affairSqlMapDao)Or maybe I should 
do it in pairs 
like:affairService.getDaoManager().startTransaction();debtorService.getDaoManager().startTransaction();..affairService.getDaoManager().commitTransaction();debtorService.getDaoManager().commitTransaction();Darek 
Dober


daoManager start/end/commit transaction problem

2005-08-04 Thread Darek Dober
Hi

I use petstore as example so I have:

affairService and debtorService which gives me method like
updateAffair(Domain affair) and updateDebtor(Domain debtor)

Now I want them to be executed in one transaction

I try to do something like this

update() {
...
try {
affairService.getDaoManager().startTransaction();

affairService.updateAffair(affair);
debtorService.updateDebtor(debtor);

affairService.getDaoManager().commitTransaction();

} catch (Exception ex) {
..
} finally {
affairService.getDaoManager().endTransaction();
}

But after that operation i have some locks in database.

Is this the correct way, or should I use start/commit/endTransaction()
method at the lower level of  ...sqlMapDao (i.e affairSqlMapDao)
Or maybe I should do it in pairs like:
affairService.getDaoManager().startTransaction();
debtorService.getDaoManager().startTransaction();

..
affairService.getDaoManager().commitTransaction();
debtorService.getDaoManager().commitTransaction();


Darek Dober



Re: SQL logging

2005-08-03 Thread Darek Dober
Try to include commons-logging.
I spent some time searching the reason:)
Ibatis depends on it, yet

Darek Dober
- Original Message - 
From: "Eugeny N Dzhurinsky" <[EMAIL PROTECTED]>
To: 
Sent: Wednesday, August 03, 2005 12:30 PM
Subject: SQL logging


> Is there any way to view the queries the iBATIS generates? I tried to set
up
> the java.sql=DEBUG, in log4j, but no luck for now.
>
> -- 
> Eugene N Dzhurinsky



Re: Stored procedure with queryForList skipresults and maxresults

2005-08-02 Thread Darek Dober



I wonder if it is possible to use skip/max in sql 
statement.
 
Every database has it's own solution for limiting 
rows:
- sql server has top
- postgresql : limit and offset
- mysql: also limit and offset ( if I have a good 
memory:)
- oracle prior to 9i combination of: rownum, order 
like this:
select * from
  (select kol1, kol2
   from table
   order by kol1)
where rownum <15
 
 
- oracle 9i provides analytic function like 
rownumber
 
and so on and on ...
 
So it seems to be possible
Have you ever considered that way?
 
 
 
Darek Dober

  - Original Message - 
  From: 
  Larry 
  Meadors 
  To: user-java@ibatis.apache.org 
  
  Sent: Monday, August 01, 2005 8:37 
  AM
  Subject: Re: Stored procedure with 
  queryForList skipresults and maxresults
  It is.When you use skip/max, the trimming is done after 
  the results are retrieved. If you are looking to improve performance, it would 
  be better to do it in the stored procedure.Larry
  On 8/1/05, Rao, 
  Satish <[EMAIL PROTECTED]> 
  wrote:
  
I am using a queryForList with skipresults and 
maxresults to retrieve records from Oracle. I have implemented this using 
 and SQL statement. I am not explicitly passing in skipresults 
and maxresults to the SQL as ibatis takes care of this. It works 
great.
Now I want to use a stored procedure instead of a 
SQL. I am assuming even for the stored procedure I don't need to pass in 
skipresults and maxresults to the stored procedure. Please confirm if my 
assumption is correct.
Thanks 



Re: synchronization between DB and ibatis sqlmaps

2005-07-20 Thread Darek Dober



Because of laziness:)
Writting test cases takes some 
time.
 
I'm developing application using Tomcat, and I 
start to realize, that testing on real application takes to much time, including 
deploying, logging on, and so on.
 
At the beginning it seemed to be a good 
choice, but it isn't. I have the problem with refreshing sqlmap files by tomcat 
(it was mentioned on this group, but doesn't work for me), so I have to deploy 
and reload application. Even using ant to reloadTask and than logon is a little 
slow. So test case seems to be the fastest way.
 
What is your advice.
Is building test cases  the best practise 
and fastest of doing this?
 
Darek
 
 

  - Original Message - 
  From: 
  Clinton 
  Begin 
  To: user-java@ibatis.apache.org 
  
  Sent: Wednesday, July 20, 2005 4:06 
  PM
  Subject: Re: synchronization between DB 
  and ibatis sqlmaps
  Why wouldn't you have test cases to test your statements 
  anyway?Cheers,Clinton
  On 7/20/05, Darek 
  Dober <[EMAIL PROTECTED]> 
  wrote:
  Do 
you have any solutions for that?Let's assume, that something changed 
in database, i.e names of tables orcolumns. And you forgot to change 
it.As far as I know I cannot check if sqlmap command is still valid, 
unless i execute it. It is difficult to execute and check all of the 
sqlmaps. Beanpropertiesare checked at creation of ibatis instance so 
you get an error, but what ifsomething changed in database?One 
of the way is to write test case, which should test all of the sqlmaps 
against any changes.Is the simplier way to check correctness of 
all sqlmapsDarek 
Dober


synchronization between DB and ibatis sqlmaps

2005-07-20 Thread Darek Dober
Do you have any solutions for that?

Let's assume, that something changed in database, i.e names of tables or
columns. And you forgot to change it.

As far as I know I cannot check if sqlmap command is still valid, unless i
execute it. It is difficult to execute and check all of the sqlmaps. Bean
properties
are checked at creation of ibatis instance so you get an error, but what if
something changed in database?

One of the way is to write test case, which should test all of the sqlmaps
against any changes.

Is the simplier way to check correctness of all sqlmaps

Darek Dober



Re: Result as Xml, and lower/upper case

2005-07-17 Thread Darek Dober
In postgresql column names are converted to lower case, unless you write
your sql like this:

SELECT   AFFR.AFFAIR_NO AS "affairNumber"
,DEBT.LASTNAME as "lastName"

Just if someone had the same problem:)

Darek Dober


- Original Message - 
From: <[EMAIL PROTECTED]>
To: 
Sent: Friday, July 15, 2005 2:09 PM
Subject: Result as Xml, and lower/upper case


> Hi,
> According to the documentation it is possible to name xml nodes with mix
of upper/lower case, i.e
> 
>   Johnson
> 
>
> But it doesn't work for me. All nodes are lower case:
>
>   
> SELECT   AFFR.AFFAIR_NO AS affairNumber
>  ,DEBT.LASTNAME as lastName
> FROM AFFAIRS AFFR
> LEFT JOIN DEBTORS DEBT ON (DEBT.DEBT_ID = AFFR.DEBT_DEBT_ID)
> ...
> 
>
> But I got xml like this
> 
>   2342342
>   Johnson
> 
>
> Ibatis 2.1.0
>
> Postgresql 8.0.1
>
> Any help would be appreciated.
> Anyone tried this ?
>
> Cheers
> Darek Dober
>



Re: multiple delete in sqlmap

2005-07-15 Thread Darek Dober
According to that what I know mysql in version 3.xx doesn't support
constraints at all:), also subqueries, triggers and so on ...

Version 4.xx has some of that futures. Check documentation. I'm not up to
date with mysql now:)

But, check i.e here. Probably it is not supported

http://groups.google.pl/group/mailing.database.myodbc/browse_thread/thread/baec3bd2912db274/f249f35401b287d0?q=mysql+multiple+statement+jdbc&rnum=2&hl=pl#f249f35401b287d0

It depends on that what version of mysql you are using.

Darek


- Original Message - 
From: <[EMAIL PROTECTED]>
To: 
Sent: Friday, July 15, 2005 4:16 PM
Subject: SV: multiple delete in sqlmap


Hi there!

Is it related rows you are trying to delete ?

Then you should define FK's between the NUM_OBJ's
on the tables and use casade delete, and delete
the row in the main table (FUN_OBJECT ??)

= only one delete statement 

But not sure if MySQL have cascade delete ??


Take care,
Erlend



-Opprinnelig melding-
Fra: olivier ZILLER [mailto:[EMAIL PROTECTED]
Sendt: 13. juli 2005 17:47
Til: user-java@ibatis.apache.org
Emne: multiple delete in sqlmap


hello,

i'm using sqlmap and mysql and try to execute a delete statement like this :



delete from FUN_ERR_OBJ where NUM_OBJ = #numObj#;
delete from FUN_INFO_OBJ_LOV where NUM_OBJ = #numObj#;
delete from FUN_INFO_OBJ where NUM_OBJ = #numObj#;
delete from FUN_GRP_INFO_OBJ where NUM_OBJ = #numObj#;
delete from FUN_LANG_OBJ where NUM_OBJ = #numObj#;
delete from FUN_ARB_OBJ where NUM_FILS_OBJ = #numObj#;
delete from FUN_CDM_OBJ where NUM_OBJ = #numObj#;
delete from FUN_PERS_OBJ where NUM_OBJ = #numObj#;
delete from FUN_OBJET where NUM_OBJ = #numObj#;


but i get this error :

--- The error occurred in /properties/channels/fr_unire/csof/sql-objet.xml.
--- The error occurred while applying a parameter map.
--- Check the deleteObjet-InlineParameterMap.
--- Check the statement (update failed).
--- Cause: java.sql.SQLException: Syntax error or access violation message
from server: "You have an error in your SQL syntax; check the manual that
corresponds to your MySQL server version for the right
syntax to use near '; delete from FUN_INFO_OBJ_LOV where NUM_OBJ
= 23; delete from F' at line 1"
Caused by: java.sql.SQLException: Syntax error or access violation message
from server: "You have an error in your SQL syntax; check the manual that
corresponds to your MySQL server version for the right
syntax to use near '; delete from FUN_INFO_OBJ_LOV where NUM_OBJ
= 23; delete from F' at line 1"
at
com.ibatis.sqlmap.engine.mapping.statement.GeneralStatement.executeUpdate(Ge
neralStatement.java:87)
at
com.ibatis.sqlmap.engine.impl.SqlMapExecutorDelegate.update(SqlMapExecutorDe
legate.java:500)
at
com.ibatis.sqlmap.engine.impl.SqlMapExecutorDelegate.delete(SqlMapExecutorDe
legate.java:523)
at
com.ibatis.sqlmap.engine.impl.SqlMapSessionImpl.delete(SqlMapSessionImpl.jav
a:93)
at
com.ibatis.sqlmap.engine.impl.SqlMapClientImpl.delete(SqlMapClientImpl.java:
65)
at
fr.unire.portal.channels.fun.csof.dao.ObjetDAO.deleteObjet(ObjetDAO.java:481
)
... 18 more
Caused by: java.sql.SQLException: Syntax error or access violation message
from server: "You have an error in your SQL syntax; check the manual that
corresponds to your MySQL server version for the right
syntax to use near '; delete from FUN_INFO_OBJ_LOV where NUM_OBJ
= 23; delete from F' at line 1"
at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:1997)
at com.mysql.jdbc.MysqlIO.sendCommand(MysqlIO.java:1167)
at com.mysql.jdbc.MysqlIO.sqlQueryDirect(MysqlIO.java:1278)
at com.mysql.jdbc.Connection.execSQL(Connection.java:2247)
at com.mysql.jdbc.PreparedStatement.execute(PreparedStatement.java:1371)
at sun.reflect.GeneratedMethodAccessor86.invoke(Unknown Source)
at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl
.java:25)
at java.lang.reflect.Method.invoke(Method.java:324)
at
com.ibatis.common.jdbc.logging.PreparedStatementLogProxy.invoke(PreparedStat
ementLogProxy.java:57)
at $Proxy2.execute(Unknown Source)
at
com.ibatis.sqlmap.engine.execution.SqlExecutor.executeUpdate(SqlExecutor.jav
a:84)
at
com.ibatis.sqlmap.engine.mapping.statement.GeneralStatement.sqlExecuteUpdate
(GeneralStatement.java:196)
at
com.ibatis.sqlmap.engine.mapping.statement.GeneralStatement.executeUpdate(Ge
neralStatement.java:74)
... 23 more

any idea on how to do that?

regards


-- 
Olivier ZILLER
CRI Gestion
Universite NANCY2
25 rue Baron Louis
BP 454 NANCY CEDEX
tel: 03 54 00 11 12 / 06 85 74 89 77 / poste 604
fax : 03 83 30 05 65



Re: [jira] Commented: (IBATIS-170) i am not sure it is a bug!

2005-07-14 Thread Darek Dober
Well

First of all, I'm not the author of that post

I only give some extra help to ensure that, in my opinion that's not a bug:)

What's more, I totally agree with you

Cheers
Darek Dober

- Original Message - 
From: "Larry Meadors" <[EMAIL PROTECTED]>
To: 
Sent: Thursday, July 14, 2005 2:21 PM
Subject: Re: [jira] Commented: (IBATIS-170) i am not sure it is a bug!


I am not an oracle guy, so maybe i am missing something really
obvious...but why would you do this as a string? It just seems like a
really fragile way to deal with this situation.

Larry


On 7/14/05, Darek Dober <[EMAIL PROTECTED]> wrote:
>
> I think, it is not a bug :)
>
> It doesn't work for me.
>
> But this does
> insert into testddo (col) values (to_date('2005-07-14
16:06:48','-mm-dd
> hh24:mi:ss'));
>
> hours: 16 should be declared as HH24 not hh
>
> Anyway:)
>
> Darek Dober
>
>
>
>
>
>
>
> - Original Message -
> From: "Larry Meadors" <[EMAIL PROTECTED]>
> To: ; ;
> 
> Sent: Thursday, July 14, 2005 1:51 PM
> Subject: Re: [jira] Commented: (IBATIS-170) i am not sure it is a bug!
>
>
> PLEASE! PLEASE! PLEASE!
>
> If you are not 99.999% sure it is a bug, do not put it in JIRA.
>
> Larry
>
> On 7/14/05, leo zhang (JIRA)  wrote:
> > [
>
http://issues.apache.org/jira/browse/IBATIS-170?page=comments#action_12315824 ]
> >
> > leo zhang commented on IBATIS-170:
> > --
> >
> > sorry, the sql statement is this:
> > insert into test (col) values (to_date('2005-07-14 16:06:48','-mm-dd
> hh:mi:ss'));
> >
> > > i am not sure it is a bug!
> > > --
> > >
> > >  Key: IBATIS-170
> > >  URL: http://issues.apache.org/jira/browse/IBATIS-170
> > >  Project: iBatis for Java
> > > Type: Bug
> > >   Components: SQL Maps
> > > Versions: 2.1.0
> > >  Environment: windows xp, professional oracle9i, eclipse
> > > Reporter: leo zhang
> >
> > >
> > > i use oralce9i database.
> > > the table names test;
> > > CREATE TABLE TEST
> > > (
> > >   col  DATE
> > > );
> > > sqlmap like this
> > >   
> > > insert into test (col) values (to_date('$timestamp$','-mm-dd
> hh:mi:ss'));
> > >   
> > > java code like this:
> > > ..
> > >  long nCurrentTime = System.currentTimeMillis();
> > >   Timestamp ts = new Timestamp(nCurrentTime);
> > > broker.insert("product.testinsert",ts.toLocaleString());
> > > ..
> > > the ibatis error is :
> > > - @@{conn-10} Connection$$
> > > - @@{pstm-11} PreparedStatement:  insert into test (col)
values
> (to_date('2005-07-14 16:06:48.921','-mm-dd hh:mi:ss'));   $$
> > > - @@{pstm-11} Parameters: []$$
> > > - @@{pstm-11} Types: []$$
> > > - [EMAIL PROTECTED] [EMAIL PROTECTED]
> [EMAIL PROTECTED] 2005.07.14 at
> 16:06:[EMAIL PROTECTED]
> > > --- The error occurred in com/ctbr/config/ibatis/sqlmap/Product.xml.
> > > --- The error occurred while applying a parameter map.
> > > --- Check the product.testinsert-InlineParameterMap.
> > > --- Check the statement (update failed).
> > > --- Cause: java.sql.SQLException: ORA-00911: invalid characters.
> > > ]
> > > but  i use toad, the follow statement can execute successful.
> > >  insert into test (col) values (to_date('2005-07-14
> 16:06:48.921','-mm-dd hh:mi:ss'));
> > > i am mad! please help me!
> > > leo
> > > [EMAIL PROTECTED]
> > > [EMAIL PROTECTED]
> >
> > --
> > 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
> >
> >
>
>



Re: [jira] Commented: (IBATIS-170) i am not sure it is a bug!

2005-07-14 Thread Darek Dober

I think, it is not a bug :)

It doesn't work for me.

But this does
insert into testddo (col) values (to_date('2005-07-14 16:06:48','-mm-dd
hh24:mi:ss'));

hours: 16 should be declared as HH24 not hh

Anyway:)

Darek Dober







- Original Message - 
From: "Larry Meadors" <[EMAIL PROTECTED]>
To: ; ;

Sent: Thursday, July 14, 2005 1:51 PM
Subject: Re: [jira] Commented: (IBATIS-170) i am not sure it is a bug!


PLEASE! PLEASE! PLEASE!

If you are not 99.999% sure it is a bug, do not put it in JIRA.

Larry

On 7/14/05, leo zhang (JIRA)  wrote:
> [
http://issues.apache.org/jira/browse/IBATIS-170?page=comments#action_12315824 ]
>
> leo zhang commented on IBATIS-170:
> --
>
> sorry, the sql statement is this:
> insert into test (col) values (to_date('2005-07-14 16:06:48','-mm-dd
hh:mi:ss'));
>
> > i am not sure it is a bug!
> > --
> >
> >  Key: IBATIS-170
> >  URL: http://issues.apache.org/jira/browse/IBATIS-170
> >  Project: iBatis for Java
> > Type: Bug
> >   Components: SQL Maps
> > Versions: 2.1.0
> >  Environment: windows xp, professional oracle9i, eclipse
> > Reporter: leo zhang
>
> >
> > i use oralce9i database.
> > the table names test;
> > CREATE TABLE TEST
> > (
> >   col  DATE
> > );
> > sqlmap like this
> >   
> > insert into test (col) values (to_date('$timestamp$','-mm-dd
hh:mi:ss'));
> >   
> > java code like this:
> > ..
> >  long nCurrentTime = System.currentTimeMillis();
> >   Timestamp ts = new Timestamp(nCurrentTime);
> > broker.insert("product.testinsert",ts.toLocaleString());
> > ..
> > the ibatis error is :
> > - @@{conn-10} Connection$$
> > - @@{pstm-11} PreparedStatement:  insert into test (col) values
(to_date('2005-07-14 16:06:48.921','-mm-dd hh:mi:ss'));   $$
> > - @@{pstm-11} Parameters: []$$
> > - @@{pstm-11} Types: []$$
> > - [EMAIL PROTECTED] [EMAIL PROTECTED]
[EMAIL PROTECTED] 2005.07.14 at
16:06:[EMAIL PROTECTED]
> > --- The error occurred in com/ctbr/config/ibatis/sqlmap/Product.xml.
> > --- The error occurred while applying a parameter map.
> > --- Check the product.testinsert-InlineParameterMap.
> > --- Check the statement (update failed).
> > --- Cause: java.sql.SQLException: ORA-00911: invalid characters.
> > ]
> > but  i use toad, the follow statement can execute successful.
> >  insert into test (col) values (to_date('2005-07-14
16:06:48.921','-mm-dd hh:mi:ss'));
> > i am mad! please help me!
> > leo
> > [EMAIL PROTECTED]
> > [EMAIL PROTECTED]
>
> --
> 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
>
>



Re: I must restart Tomcat when I modify some SQL Map XML files in SQLMapConfig.xml

2005-07-12 Thread Darek Dober



Can't you just use manager included in 
Tomcat,
 
you can reach it at /manager/html/list and 
then just reload application ? I do that:)
 
Darek
 

  - Original Message - 
  From: 
  Zarar Siddiqi 
  To: user-java@ibatis.apache.org ; Sylvain Pelletier 
  Sent: Monday, July 11, 2005 7:20 PM
  Subject: Re: I must restart Tomcat when I 
  modify some SQL Map XML files in SQLMapConfig.xml
  
  Instead of restarting Tomcat, perhaps you should 
  setup your application so that you just have to reload/redeploy the context 
  for the startup listeners to kick in.  Restarting tomcat can be slow 
  while reploying works like a breeze.  I'm using Intellij and you can 
  run Tomcat within it. I'm sure Eclipse has the same feature.
   
  Zarar
  
- Original Message - 
From: 
Sylvain Pelletier 
To: user-java@ibatis.apache.org 

Sent: Saturday, July 09, 2005 7:42 
AM
Subject: I must restart Tomcat when I 
modify some SQL Map XML files in SQLMapConfig.xml

Hi,
 
First I'm new to the sqlmap's world!
 
I'm using sqlmap without using the dao manager of ibastis.
I work under myeclipse and when I modify the content of SQL MAP xml 
files (to add a select statement for example), the changes are not do in 
real-time. 
I'm actually restarting tomcat each times I changes  SQL 
MAP xml files and it's a quite boring !!
 
Thanks
 
Sylvain
 


Re: Best mechanism to read large datasets

2005-07-08 Thread Darek Dober
Title: Best mechanism to read large datasets



Can you explain or anyone else, how it 
works or what is the best practise? 
I think that statement is open, and for 
each row method public void handleRow (Object 
object);  is invoked or 
something like that
 
I assume, that we want to process a large 
datasets, and do some operations.
 
Should't be better in that case to use stored 
procedure, and use i.e cursor in database to handle this, if we have such 
opportunity?
It seems to be much faster, then using JDBC. 
We are working on large datasets.
 
I don't have time for excercise now, but for 
500 000 records to process, using only stored procedure, should be much 
faster.
 
What are your opinions?
 
 
 
Darek Dober

  - Original Message - 
  From: 
  Michal 
  Malecki 
  To: user-java@ibatis.apache.org 
  
  Sent: Friday, July 08, 2005 4:22 PM
  Subject: Re: Best mechanism to read large 
  datasets
  
  Hello,
  I think queryWithRowHandler should do the trick :)
   
  Regards
  Michał Małecki- Original Message - 
  
From: 
Rao, Satish 

To: user-java@ibatis.apache.org 

Sent: Friday, July 08, 2005 4:10 
PM
Subject: Best mechanism to read large 
datasets

I have a situation where I might be retrieving 
thousands of rows from Oracle. I am using a queryForList() and I am assuming 
it stores the rows in memory. As a result I am quickly running out of 
memory.
Is there a way for ibatis to read each row from 
table and discard it as soon as it is processed, so I don't run into out of 
memory issues?


Re: Best mechanism to read large datasets

2005-07-08 Thread Darek Dober
Title: Best mechanism to read large datasets



Can't you divide your result into pages with 
smaller number of records ?
 
queryForList with proper parameters should do 
that.
 
Darek

  - Original Message - 
  From: 
  Rao, Satish 
  
  To: user-java@ibatis.apache.org 
  
  Sent: Friday, July 08, 2005 4:10 PM
  Subject: Best mechanism to read large 
  datasets
  
  I have a situation where I might be retrieving 
  thousands of rows from Oracle. I am using a queryForList() and I am assuming 
  it stores the rows in memory. As a result I am quickly running out of 
  memory.
  Is there a way for ibatis to read each row from 
  table and discard it as soon as it is processed, so I don't run into out of 
  memory issues?


Avoiding N+1 selects

2005-07-03 Thread Darek Dober
Hi
According to the documentation it is possible to ommit N+1 selects using
i.e:








What if category has several attributes, I wouldn't like to recopy them to
other resultMap. Adding new attributes, requires
to place it in two or more resultMaps.
I would like just to reuse categoryMap from somewhere else.

Something like this on page 28 (resultMap):







But according to the documentation calendarQuarter is expected to have get
and set methods for months, as a List,
I would like to have only one month of class calendarMonth

Example mentioned above, throws exception: ClastCastException, I suppose it
expects months to be List, but I would like it to be one CalendarMap

Is it possible, to point down, that I want only one Bean, not the List?

Regards
Darek Dober