RE: SQL Server JDBC drivers

2007-03-21 Thread Abdullah Kauchali
Avoid using @@Identity and instead use Scope_Identity(). Here is a blogg that summarises the point: http://cf-bill.blogspot.com/2005/08/identity-scopeidentity-identcurrent.html Has links to MSDN for details. Regards, A -Original Message- From: Niels Beekman [mailto:[EMAIL

RE: What is RequestScope used for?

2007-03-06 Thread Abdullah Kauchali
Notwithstanding the OP's issue . is there any sensible way of preventing this? Ie. how to detect connections are being returned to the pool without them properly ending transactions? Is it even possible? From: Clinton Begin [mailto:[EMAIL PROTECTED] Sent: Tuesday, March 06, 2007

RE: SQLServer problem

2007-02-23 Thread Abdullah Kauchali
Try the latest Microsoft Driver for 2005: http://msdn2.microsoft.com/en-us/data/aa937724.aspx See if that helps. From: Luca Panzetti [mailto:[EMAIL PROTECTED] Sent: Friday, February 23, 2007 10:50 AM To: user-java@ibatis.apache.org Subject: SQLServer problem Hi All, I have

RE: Avoiding N+1 Selects

2007-02-20 Thread Abdullah Kauchali
Hi Brad, Have a look at the WITH statement (it is ANSI specified) and CTE's (common table expressions). Here is an example with SQL 2005. http://msdn2.microsoft.com/en-us/library/ms186243.aspx I am sure the logic will also work off Oracle versions that support the WITH statement

How does iBatis know which connection object to use from a pool?

2007-02-07 Thread Abdullah Kauchali
As I understand it, SqlMapClientImpl (SqlMapClient) hides or wraps the primary JDBC object, Connection. So, we can essentially do everything with SqlMapClient that we can with JDBC's Connection object (including starting, commiting or aborting transactions). However, with iBatis, we don't

Re: How does iBatis know which connection object to use from a pool?

2007-02-07 Thread Abdullah Kauchali
From: Larry Meadors [EMAIL PROTECTED]: All connectins and transactions are managed using thread local storage, so each thread has it's own connection, etc.. (Thanks Larry!) Ok. Understood. So, each time a new thread that uses SqlMapClientImpl is spawned, a Connection object is removed

RE: How does iBatis know which connection object to use from a pool?

2007-02-07 Thread Abdullah Kauchali
Larry: Almost, but not exactly. ;-) The connection does not remain with the thread for the life of the thread, but rather the thread gets the connection from the pool (the pool marks it as used so no one else gets it), then uses it, then closes it (which just tells the pool that it can

Difference between DBCP and SIMPLE connection pools

2007-02-06 Thread Abdullah Kauchali
Hi folks, What's the difference between configuring connections as DBCP vs SIMPLE? When to use which? TIA, A

RE: Difference between DBCP and SIMPLE connection pools

2007-02-06 Thread Abdullah Kauchali
Hi Clinton - thanks for responding. SimpleDataSource has served us very well over the years, with very few changes. I'd like to redo the interface at some point (currently yucky property based config), but the implementation seems to work well. It's a synchronous pool that doesn't spawn

Typo in iBatis document

2007-02-06 Thread Abdullah Kauchali
Noticed an incorrect case for an XML close tag in iBatis Developer Guide page 13 (date 9 August 2006) (Maybe's it's been fixed.) /datasource should be /dataSource

Can we do with specifying resultClass and parameterClass at runtime?

2007-01-30 Thread Abdullah Kauchali
... instead of in the sqlmap xml files? Given this hypothetical sqlmap (without explicit parameterClass and resultClass): select id=selectAllPersons SELECT [person_id] id ,[person_name] name ,[person_description] description FROM [TBL_person] /select What do you

RE: Can we do with specifying resultClass and parameterClass at runtime?

2007-01-30 Thread Abdullah Kauchali
Hi Jeff! You can delay parameterClass to runtime already - you don't need to specify it at configuration time. Yes, of course: queryForList(String id, Object paramObject) does that already! (Sorry, my previous message where I gave an example of the API was wrong. It should

RE: Getting straight at the ResultSet

2007-01-04 Thread Abdullah Kauchali
Hi Tegan, I once made a feature request for something like this: http://issues.apache.org/jira/browse/IBATIS-206 It didn’t receive any serious consideration though, perhaps more on grounds of ideology than of practicality. The basis of my request was that if we have the RowHandler

RE: Arrays instead of java.util.List?

2006-10-08 Thread Abdullah Kauchali
:13 AM To: user-java@ibatis.apache.org Subject: Re: Arrays instead of java.util.List? Abdullah, Why do you want to use Arrays[]? Lists are better because they can grow and can always be converted into an array. -Richard Abdullah Kauchali wrote: Hi Larry, Yup, I can do that. But how

Arrays instead of java.util.List?

2006-10-07 Thread Abdullah Kauchali
Does iBatis support resultsets as arrays or the population of beans that have array properties instead of java.util.List? From the example doc: resultMap id=categoryResult class=com.ibatis.example.Category groupBy=id result property=id column=CAT_ID/ result property=description

RE: Arrays instead of java.util.List?

2006-10-07 Thread Abdullah Kauchali
Abdullah Kauchali: I have a complex type as a Java Bean that I'd like to populate using the 1:M ibatis facility and I cannot serialize a java.util.List - only array of objects. Complex type as in a web services complex type.

RE: Arrays instead of java.util.List?

2006-10-07 Thread Abdullah Kauchali
Sent: Saturday, October 07, 2006 7:12 PM To: user-java@ibatis.apache.org Subject: Re: Arrays instead of java.util.List? Nope, but you can do this easy enough: return (YourType[])queryForList(blah.query, parms).toArray(new YourType[0]); Larry On 10/7/06, Abdullah Kauchali [EMAIL PROTECTED

Re: iBatis and ORM's

2005-11-07 Thread Abdullah Kauchali
Clinton Begin wrote: The fact that it currently translates the resultsets into an object model As a matter of fact, it could be argued that /that/ part of iBatis is its /weakness/. That part? That's not a part...that's ALL iBATIS does. If you've misunderstood that, then I'm sorry for our

Re: iBatis and ORM's

2005-11-07 Thread Abdullah Kauchali
Abdullah Kauchali wrote: BTW, I mean offense or disrespect LOL. I mean *NO* offense or disrespect ... Sheesh, as if the discussion isn't sensitive already! :-D

Re: iBatis and ORM's

2005-11-06 Thread Abdullah Kauchali
Clinton Begin wrote: This is really good discussion. I hope you guys help Kim with the FAQ, and post your feature requests to JIRA (I think use iBATIS as a spreadsheet is already in there). ;-) If you mean my JIRA entry, then I agree. But, hey, you started the iBatis is a spreadsheet

Re: iBatis and ORM's

2005-11-06 Thread Abdullah Kauchali
Alan Chandler wrote: Hang on a sec here, don't we also map Java Classes to database tables with iBatis? A User class in my design maps to a User table in the database. Isn't this exactly how the iBatis docs tell us we should map our result beans? Well a) I was simplifying, but yes we

Re: iBatis and ORM's

2005-11-05 Thread Abdullah Kauchali
Clinton Begin wrote: Try this with Hibernate: int i = (Integer) client.queryForObject (countUsersInGroup, MyGroup); select id=countUsersInGroup resultClass=int parameterClass=string SELECT Count(1) FROM Users WHERE GroupName = #groupName# /select So, we're saying Hibernate has to

Re: iBatis and ORM's

2005-11-05 Thread Abdullah Kauchali
Alan Chandler wrote: Wow - thank you very much. I had long been wondering why I was so attracted to iBatis rather than Hibernate given that the latter is obviously the way everyone has been going. Its made a light come on in my head. Yeah, I like the way Clinton writes about these

Re: iBatis and ORM's

2005-11-05 Thread Abdullah Kauchali
Alan Chandler wrote: http://home.chandlerfamily.org.uk/archive/26/ibatis-v-hiberbate) Quote In simple terms, Hibernate maps Java Objects to database tables. iBatis maps Java Objects to SQL statements. /Quote Hang on a sec here, don't we also map Java Classes to database tables with iBatis?

iBatis and ORM's

2005-11-04 Thread Abdullah Kauchali
So, iBatis is /not/ an ORM. What makes Hibernate an ORM and iBatis not? or a corollary: What makes iBatis a DAO implementation and Hiberate not? (Is this a valid question, to begin with?) What are the /decisive/ qualities of each (viz. DAO vs ORM) that classify them appropriately? I am

Re: iBatis and ORM's

2005-11-04 Thread Abdullah Kauchali
Fantastic. Some more questions in-line. g Clinton Begin wrote: ORM 1) Maps classes to tables, and columns to fields. Don't we do that with iBatis too? Are we saying that mapping classes to tables, and columns to fields is generally a bad idea? 2) Must support Object Identity Yes,

Re: iBatis and ORM's

2005-11-04 Thread Abdullah Kauchali
Larry Meadors wrote: Man, this is a big one, and i am late already..i'll get it started. Sorry. :) I know Friday's almost over, but I need some ammo for something I am preparing for next week. The question is not DAO vs ORM, it is ORM vs Data Mapping. Got it! ORM = mapping

Re: iBatis and ORM's

2005-11-04 Thread Abdullah Kauchali
netsql wrote: Let me try another approach of how I answer this: Thanks, I appreciate it greatly! :) SQL is a set processing langage. You select a set, update a set where, etc., SQL engines are optimised for this for many decades. (See set theory, unions, intersections, SQL PT, etc.) In

Switching from local to global Transactions at runtime?

2005-10-20 Thread Abdullah Kauchali
(Been out of the loop for a while ... so apologies for stupid question.) Is it possible to switch the transactional properties from local to global at runtime? Are there any good examples I can use? I am aware that the SqlMapClient, when created, relates to one of the following transactional

Ibatis and Spring Framework

2005-08-04 Thread Abdullah Kauchali
Can someone who has experience with the Spring Framework please help me explain briefly what advantages it could afford /along with/ the use of Ibatis. What is it that the Spring offers that IBatis does not? (I know that Spring is multi-facetted, it does AOP stuff etc - but I am asking

Re: iBATIS 2.1.5 is out (despite the website)

2005-07-19 Thread Abdullah Kauchali
Abdullah Kauchali wrote: 2. the possibility of writing your own result maps directly from the JDBC resultset. Let me rephrase that: 2. The possibility of /extending/ the standard iBatis array of return types to wire in a custom one without needing XSL transformations etc (I hate XSL(tm)). :)