Java Reference
In-Depth Information
So, for example, you may have a SQL map named Account , with mapped statements
named insert , update , delete , and getAll . When you want to insert an account,
you would call the Account.insert mapped statement when namespaces are used.
You can have as many mapped statements (in other maps) named insert as
needed, and the names will not collide.
While you could accomplish the same thing using names like insertAccount ,
using namespaces can be very helpful when working with large systems, because it
helps in finding statements if they are not organized logically.
maxRequests (deprecated)
A request is any SQL operation—an insert, update, delete, or a stored procedure
call. In our example, we are scaling back and only allow 32 requests to be active at
one time instead of the default value of 512.
maxSessions (deprecated)
A session is a thread-level mechanism that is used to track information about a
group of related transactions and requests. In our example, we allow only 10 ses-
sions at any time, instead of the default value of 128.
maxTransactions (deprecated)
A transaction is just what it appears: a database transaction. As with maxRequests , we
have reduced the number of active transactions to 5 from the default value of 32.
These settings are complicated to understand, but luckily they are depre-
cated. In future versions of i BATIS , you won't need to configure them
manually. So, for the most part, you should simply never modify them.
The default settings will work for most systems of a reasonable scale. If
you do modify the settings, always ensure that maxRequests is larger than
maxSessions , and that maxSessions is larger than maxTransactions . A
simple rule of thumb is to keep the ratios the same. Also note that none
of these settings directly impacts the number of connections in your con-
nection pool or any other resources that your application server is
responsible for managing.
OK , that is all you need to know about the <settings> element. Let's move on—
we are almost done!
The <typeAlias> elements
Nobody likes to type in a name like org.apache.ibatis.jgamestore.domain.Ac-
count if they do not have to. The <typeAlias> element lets you define an alias
such as Account that can be used in place of that fully qualified class name.
Search WWH ::

Custom Search