Re: transaction rollback

2005-08-17 Thread Oleg Shpak
Eugeny, make sure you are using a table type which supports transactions such as InnoDB. A statement like below can show you which type/engine you are using show create table ; it outputs the following: CREATE TABLE ( ... ) Type=InnoDB ... ; (or ENGINE=InnoDB for MySQL 4.1). If the type i

transaction rollback

2005-08-17 Thread Eugeny N Dzhurinsky
Hi I'm trying to rollback the transaction with SqlMapClient. the source looks like client.startTransaction(); //some insert/select calls client.endTransaction(); the inserted data remains in the table, but is shouldn't (it's unit-test) there is MySQL at the backend. Any ideas? -- Eugene N Dzhur

preparation failed "UndeclaredThrowableException"

2005-08-17 Thread Warren Bell
I am getting a preparation falied "UndeclaredThrowableException" when I call: return (Integer) executeQueryForObject("getTaxable", item); The SQL Map is: SELECT count(1) as value FROM ecrs_v_InventoryMaster, ecrs_TaxMain, ecrs_StockInventoryLinkTax WHERE ecrs_v_InventoryMaster.INV_PK = ec

Re: Getting auto-generated keys in mySql

2005-08-17 Thread Alan Hicks
Was not aware of this Larry -Thanks. Will try your solution. Just a thought. If you do use 'SELECT LAST_INSERT_ID()' and two tables have been auto-incremented which ID does it return? Alan. "Learn something NEW everyday" On Wed, 17 Aug 2005 22:46:19 +0100, Larry Meadors <[EMAIL PROTECTED]>

RE: Transaction question

2005-08-17 Thread Rafiq, Adnan
A somewhat related question... We are using Stateless Session beans for transaction management. In this case, is it still a good idea to code 'daoManager.startTransaction' and other transaction-related methods as described in the code in the previous mail? We use an XA jdbc driver as there are

Fwd: where can I find a simple implementation example

2005-08-17 Thread Larry Meadors
Oops, i only replied to salim... -- Forwarded message -- From: Larry Meadors <[EMAIL PROTECTED]> Date: Aug 17, 2005 4:35 PM Subject: Re: where can I find a simple implementation example To: Salim Madjd <[EMAIL PROTECTED]> On 8/17/05, Salim Madjd <[EMAIL PROTECTED]> wrote: > > How

Re: Getting auto-generated keys in mySql

2005-08-17 Thread Larry Meadors
NO! That is really, really not thread safe! Imagine what happens when 2 ppl do inserts at the same time... [insert #1][insert #2][query #1][query #2] Both [query #1] and [query #2] return the same id. Ooops! kaboom! Larry On 8/17/05, Alan Hicks <[EMAIL PROTECTED]> wrote: > Hi Brian, > > I h

Re: Getting auto-generated keys in mySql

2005-08-17 Thread Alan Hicks
Hi Brian, I had the same problem and could not find any working examples. Finally I stumbled upon the query where 'userId' is an auto-generated key in my mysql table. If you replace the query you have with this one you should be in business. SELECT MAX(userId) FROM tb_user Hope this help

Re: Getting auto-generated keys in mySql

2005-08-17 Thread Larry Meadors
M$SQL to MySQL?! Good for you! SELECT LAST_INSERT_ID() Larry PS: I'd use pgsql instead though. ;-) On 8/17/05, Barnett, Brian W. <[EMAIL PROTECTED]> wrote: > We've been using SQL Server and are moving to mySQL. Can somebody tell me > how to do this for mySql: > > > SELECT @@IDENTITY

RE: Transaction question

2005-08-17 Thread Niels Beekman
Hi, I'm facing this exact same problem however in a somewhat different context, see the following archived thread: http://www.mail-archive.com/ibatis-user-java@incubator.apache.org/msg025 80.html http://www.mail-archive.com/user-java@ibatis.apache.org/msg00036.html I recently restarted my inves

Getting auto-generated keys in mySql

2005-08-17 Thread Barnett, Brian W.
We've been using SQL Server and are moving to mySQL. Can somebody tell me how to do this for mySql: SELECT @@IDENTITY AS id TIA, Brian Barnett This email may contain confidential material. If you were not an

Re: where can I find a simple implementation example

2005-08-17 Thread Larry Meadors
On 8/17/05, Salim Madjd <[EMAIL PROTECTED]> wrote: > Thanks, Larry. > > Yes, I have gone this far and have all the config and maps setup based on > the documentations. > > Your example is great for stand-alone application. But I am looking for web > application (tomcat 5.x and above or any

Re: where can I find a simple implementation example

2005-08-17 Thread Salim Madjd
Thanks, Larry.   Yes, I have gone this far and have all the config and maps setup based on the documentations.   Your example is great for stand-alone application. But I am looking for web application (tomcat 5.x and above or any servlet 2.3 container) and some best practices. For example, where sh

Re: where can I find a simple implementation example

2005-08-17 Thread Salim Madjd
Prashanth, Thanks for your email. I had already looked at the petstore. And as I said in my email I am looking for a simple example that does NOT include strut or spring.   I was hoping to find a simple example without the involvement of strut and spring. Using petstore as an example it forces any

Re: where can I find a simple implementation example

2005-08-17 Thread Larry Meadors
This is as simle as it can possibly get: http://www.mail-archive.com/ibatis-user-java@incubator.apache.org/msg01759.html Larry On 8/17/05, Prashanth Sukumaran <[EMAIL PROTECTED]> wrote: > IBatis PetStore. > > http://ibatis.apache.org/petstore.html > > --- Salim Madjd <[EMAIL PROTECTED]> wrote

Transaction question

2005-08-17 Thread Barnett, Brian W.
What are some good options to deal with the following: ServiceClass1 public void doSomething() { try { daoManager.startTransaction(); // Write some stuff to a database daoManager.commitTransaction(); } catch (Exception e) {

Re: Lists of like objects as parameters to SqlMaps

2005-08-17 Thread Eric Sheffer
In a previous message, Prashanth Sukumaran wrote: > > When executing in batch mode i do this. > > try { > startTransaction(); > > startBatch(); > for (int i = 0; i < dealerFrLines.length; i++) { > param.put("dealerFrLines", new Integer(dealerFrLines[i])); >

Re: where can I find a simple implementation example

2005-08-17 Thread Prashanth Sukumaran
IBatis PetStore. http://ibatis.apache.org/petstore.html --- Salim Madjd <[EMAIL PROTECTED]> wrote: > Hi, > I have read a lot of documentations and I still can not put the whole thing > together, yet. > I just want to see a simple implementation using servlet or jsp directly > without involvin

where can I find a simple implementation example

2005-08-17 Thread Salim Madjd
Hi, I have read a lot of documentations and I still can not put the whole thing together, yet. I just want to see a simple implementation using servlet or jsp directly without involving strut or spring. I like to see a simple jsp page displaying a select statement and the jsp page displaying foo

Re: Lists of like objects as parameters to SqlMaps

2005-08-17 Thread Koka
It will be indeed very handy to have list insert/update/delete/statement methods. And it even seems quite natural to have queryForObject - queryForList insert- insertList(String statementName, List list) etc. Koka

Re: Dynamic Database URL

2005-08-17 Thread Nathan Maves
Will this still work the same with DaoManagerBuilder.buildDaoManager(reader, props); We do not explicitly call SqlMapClientBuilder.buildSqlMapClient (configReader,properties). I assume that the DAO Manager calls it. And if this is the case with the props in the first line above be passed t

Re: Lists of like objects as parameters to SqlMaps

2005-08-17 Thread Prashanth Sukumaran
Hi Eric, Sometimes it is not good to advice people when you don't know it fully yourself. But this is how i would do. In normal JDBC i would achieve this by batchInsert. Similar is the case with iBatis. When executing in batch mode i do this. try { startTransaction(); start

Lists of like objects as parameters to SqlMaps

2005-08-17 Thread Eric Sheffer
First of all, thanks for developing iBATIS! It's very slick! Perhaps I'm missing something, but I've been unable to find any information about this question. I've searched through the documentation and posts to the mailing list and I'm surprised this question hasn't been asked yet: is it possi