Re : ibatis db pool or dbcp

2009-01-20 Thread Gilles Schlienger
In our case, we started by using the dbcp library packaged with tomcat 5.5, but we ended up having strange long delays with long requests, so we switched to c3p0 and since then everything is fine. Gilles De : Nathan Maves À : user-java@ibatis.apache.org Env

Re: ibatis db pool or dbcp

2009-01-20 Thread Clinton Begin
Yes, they're both fine for production. iBATIS SimpleDataSource has been around since iBATIS 1.0 and has changed very little (but it does get a major facelift in iBATIS 3.0). The difference between the iBATIS SimpleDataSource and most others is that it's a synchronous datasource. That is, it does

Re: ibatis db pool or dbcp

2009-01-20 Thread Clinton Begin
PS: If you're using an application server, my recommendation is to use the container managed DataSource... always always always... Cheers, Clinton On Tue, Jan 20, 2009 at 6:37 AM, Clinton Begin wrote: > Yes, they're both fine for production. iBATIS SimpleDataSource has been > around since iBAT

[SURVEY] How many connections are in your pool?

2009-01-20 Thread Clinton Begin
Hi all, I've been studying a few large enterprise applications and have noticed an interesting trend... many of these apps have HUNDREDS of connections (like 600) available or even open in their connection pools... Survey Questions: 1. How many connections do you have available in your pool?

RE: iBATIS caching / transaction isolation question

2009-01-20 Thread Young, Alistair
Thanks, Clinton. I think I have it all straight in my head now! Sounds like we need to proceed with caution. Cheers, Alistair. From: Clinton Begin [mailto:clinton.be...@gmail.com] Sent: 20 January 2009 05:25 To: user-java@ibatis.apache.org Subject: Re: i

Re: ibatis db pool or dbcp

2009-01-20 Thread Rick
On Tue, Jan 20, 2009 at 8:38 AM, Clinton Begin wrote: > PS: If you're using an application server, my recommendation is to use the > container managed DataSource... always always always... I'm just curious why? Is it because of possible monitoring tools (like maybe a server's JMX hooks?.) For e

Problem during SqlMapClientBuilder.buildSqlMapClient

2009-01-20 Thread thelime
Hi I have an application that runs every day of the week 8 - 10 times for a different piece of information each time. On 1 of those jobs for the last few days I've had a problem. This is a batch application and it just hangs, doesn't throw any exceptions or anything. It just stops dead it's in tr

Excessive memory usage (feature or bug?)

2009-01-20 Thread Jeff P
Hello. My application is using iBatis' method "querForList". However, after I execute this method my memory useage sky-rockets upwards. I have profiled my application and it happends when I execute the following method: public static List selectUnsyncedCityByDate(SyncDates syncDates, int sk

Re: Excessive memory usage (feature or bug?)

2009-01-20 Thread Larry Meadors
This *really* depends on the JDBC driver - if there is a way to limit the list via SQL, do that instead of skip and max. What DB are you using? Larry

Re: Excessive memory usage (feature or bug?)

2009-01-20 Thread Jeff P
Sorry for forgetting to mention that. I'm using MySQL with MyConnectorJ5.1.7 I've tried a test with the Rowhandler and unfortunatly memory also jumps up tremendously after the database connection has been established (5mb to 50mb). Larry Meadors wrote: > > This *really* depends on the JDBC dr

Re: Excessive memory usage (feature or bug?)

2009-01-20 Thread Jeff P
For what its worth... my profiler says the 3 biggest memory hogs are: byte[] (65%) byte[][] (20%) com.mysql.jdbc.ByteArrayRow (10%) I've attached a screenshot of the profiling results. Perhaps this rings a bell? Thanks! http://www.nabble.com/file/p21568927/profiling_results.png -- View this

Re: Excessive memory usage (feature or bug?)

2009-01-20 Thread Larry Meadors
Look into using the LIMIT keyword in your select. Something like this: select * from city where syncDate < ? and syncDate > ? limit $skip$, $max$ You'll need to add those values to the parameter object. Larry On Tue, Jan 20, 2009 at 11:22 AM, Jeff P wrote: > I'm using MySQL with MyConnector

Re: Excessive memory usage (feature or bug?)

2009-01-20 Thread Larry Meadors
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 byt

Re: [SURVEY] How many connections are in your pool?

2009-01-20 Thread Nicholoz Koka Kiknadze
Ours is an application that requires guaranteed response times under 50 ms, so: 1) We dropped using any kind of pool, so that 2) number of constantly open connections equals to the number of processors (16) 3) I know you were asking about pool, but still I dared to respond with this no-pool varia

Re: [SURVEY] How many connections are in your pool?

2009-01-20 Thread Clinton Begin
It sounds like you're still using a "pool", but your max, min, idle, and active connections are all equal (i.e. 16). Otherwise, how do you allocate connections to the incoming requests? Cheers, Clinton On Tue, Jan 20, 2009 at 12:33 PM, Nicholoz Koka Kiknadze wrote: > Ours is an application tha

Re: [SURVEY] How many connections are in your pool?

2009-01-20 Thread Sundar Sankar
Hi Clinton, I apologize ahead, if I am missing or not getting something right. As far as my understanding goes, arent number of connections in a pool in relation to the number of parallel users that access the application than the number of CPU cores in a database? Regards S On

Re: [SURVEY] How many connections are in your pool?

2009-01-20 Thread Nicholoz Koka Kiknadze
We have a pool of 16 threads (one per cpu) with a single connection assigned per thread, so its rather a thread pool... On Tue, Jan 20, 2009 at 2:39 PM, Clinton Begin wrote: > It sounds like you're still using a "pool", but your max, min, idle, and > active connections are all equal (i.e. 16). O

Composite 1-1 Relationship

2009-01-20 Thread Petr V.
This is a very basic problem, and I have tried many combination but it is not working at all. I have two table , let assume, there is 1-1 relationship for simplification of problem at hand Teacher(id, name) Student(id,name,teacher_id) The two beans are public class Teacher {     private Int

Re: [SURVEY] How many connections are in your pool?

2009-01-20 Thread Nicholoz Koka Kiknadze
Hi Sundar, I am not an hardware expert, but I suspect that even with modern dma access etc if you ask your CPU to process N database transactions (initiated by different users) in parallel it may take longer compared to when you ask it to do them consequently. So quite possible that pools with con

Re: [SURVEY] How many connections are in your pool?

2009-01-20 Thread Sundar Sankar
Thanks Nicholoz! I have never ever questioned people for having so many connections. But that was the reason what I have always got, i.e, Connections being propotionate to number of parallel users. I just brought the question about because, I wasnt surprised at all

Re: Composite 1-1 Relationship

2009-01-20 Thread Petr V.
Can any body please help me, I am now getting very frustrated. Whole day consumed and no progress to show :-( I strictly followed the steps at http://ibatisnet.sourceforge.net/DevGuide/ar01s03.html#d0e1036 but no luck. I converted my code to 1-M public class Teacher {     private Integer id;  

Re: [SURVEY] How many connections are in your pool?

2009-01-20 Thread Nathan Maves
I am no expert in this either but a default setup for oracle allows for 200 connections. At least this was the case a few version back. In my mind I think you can an maybe should have more connections than processors. Depending on the length of time the connection is open and idle. Again I coul

Re: Composite 1-1 Relationship

2009-01-20 Thread Larry Meadors
That's for the .net version. On Tue, Jan 20, 2009 at 3:42 PM, Petr V. wrote: > I strictly followed the steps at > http://ibatisnet.sourceforge.net/DevGuide/ar01s03.html#d0e1036 but no luck. >

Re: Excessive memory usage (feature or bug?)

2009-01-20 Thread Jeff P
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

using iBatis without transaction?

2009-01-20 Thread Xiangrong Fang
Hi There, How can I use iBatis without starting an transaction? I try to do: PRAGMA synchronous=OFF for SQLite database, but iBatis report an SQLExeption that this cannot be done within an transaction. Then I used: Connection conn = SqlMapClient.getDataSource.connection; Statement st = conn.c

Re: [SURVEY] How many connections are in your pool?

2009-01-20 Thread Rick
So all this being said what is the general rule of thumb for setting up pool sizes? On Tue, Jan 20, 2009 at 5:43 PM, Nathan Maves wrote: > I am no expert in this either but a default setup for oracle allows for 200 > connections. At least this was the case a few version back. In my mind I > thi

Re: Composite 1-1 Relationship

2009-01-20 Thread Petr V.
Thanks Larry for helping me out. What a miserable mistake at my end :-( Just started iBatis and had no idea that xml configuration could be changed from dot net to java. Any how, here is a working example for archives so if some one new search then he could find a working example.           

2 Way 1-1 relationship

2009-01-20 Thread Petr V.
I want to have two way relationship like Teacher contains reference of Student and Student contains reference of Teacher. Is it even possible in iBatis ? class Teacher {      Student sid; } class Student {      Teacher teacher; } I wrote the following SQL config file an

Re: [SURVEY] How many connections are in your pool?

2009-01-20 Thread Clinton Begin
Absolutely. In addition to general resource contention (CPU, Disk I/O etc.), you also have to consider lock contention against the database tables themselves. Relational databases do not scale well in this regard. Throw as much CPU power and hardware against your database as you like, as soon as

Re: using iBatis without transaction?

2009-01-20 Thread Clinton Begin
use the EXTERNAL transaction manager and pass in your own connection. cheers, Clinton On Tue, Jan 20, 2009 at 4:57 PM, Xiangrong Fang wrote: > Hi There, > > How can I use iBatis without starting an transaction? I try to do: > > PRAGMA synchronous=OFF > > for SQLite database, but iBatis report

Re: [SURVEY] How many connections are in your pool?

2009-01-20 Thread Sundar Sankar
Thanks So much Clinton. That was terrific! -Sundar On Tue, Jan 20, 2009 at 9:12 PM, Clinton Begin wrote: > Absolutely. In addition to general resource contention (CPU, Disk I/O > etc.), you also have to consider lock contention against the database tables > themselves. Relational databases do

Re: [SURVEY] How many connections are in your pool?

2009-01-20 Thread Mario Ds Briggs
Not sure about 600, but i have heard of cases where the connection pool size was so large, it brought down the DB server when the pools were intialized. Clinton Begin

Re: [SURVEY] How many connections are in your pool?

2009-01-20 Thread Zoran Avtarovski
By no means am I an expert in this field, but last year I was working on a large app. The DB guy had pretty impressive knowledge, not just about databases but also app servers and connecting to DB¹s in general. He had done some performance monitoring on a number systems with varying loads and conne