Comments (5)
To verify what I mean by "on-the-fly verification," I'm simply suggesting that
result maps aren't verified against their mapped classes until they are
actually used. In any one session, a very small percentage of the actual tables
in a database are interacted with and it seems like a waste of CPU cycles.
I'm suggesting this because we've recently implemented some WCF services that
use iBatis, and MyBatis has to reinitialize and verify its maps every time a
new connection to the service is established.
Original comment by [email protected]
on 2 Sep 2010 at 12:42
from mybatisnet.
Maybe this problem shoul be a major priority. Applications that works with big
databases "go on line" too slowly.
Original comment by [email protected]
on 2 Nov 2010 at 9:43
from mybatisnet.
Just an update here. You can force verification of all of the maps by simply
looping through them; we put this function in our Mapper class and call it once
the mapper is init'd:
Public Overridable Sub PreLoad()
' The trick is to load all of the statements for the mapper, which can
' be done by simply accessing their collection properties.
Dim loadStatements As IEnumerator = Me.Mapper.MappedStatements.GetEnumerator()
Dim loadParameterMaps As IEnumerator = Me.Mapper.ParameterMaps.GetEnumerator()
Dim loadResultMaps As IEnumerator = Me.Mapper.ResultMaps.GetEnumerator()
End Sub
This doesn't contribute much to the topic but is slightly related.
Original comment by [email protected]
on 8 Nov 2010 at 7:06
from mybatisnet.
I agree, that this issue should be of higher priority. We have a long
initialization time with a large number of sql maps too. All maps are loaded on
startup and only a small number of them are really used. There should be a
runtime mode which lazy loads and validates maps only when they are really
executed.
Original comment by [email protected]
on 16 Nov 2010 at 11:55
from mybatisnet.
I think the big issue with lazy-loading the maps when they are needed is that
it might not be that trivial, all because you can reference maps and mappings
from other SQL maps
Let's say you had <TableXYZMapper.xml>, and one of it's <resultMap>'s <result>
attributes was <result ... resultMapping="TableABCMapper.SomeResultMapID" />.
Would MyBatis know at the time it needs to lazy-load TableXYZMapper that it
also needs to load TableABCMapper? As it exists now, it loads everything all at
once so it doesn't have to worry about these cross referenced setups.
This is the wall I hit when I described how "I've looked through the source
code and it's a bit more complicated than I had hoped or I might have tried to
do this myself" in my bug report.
Original comment by [email protected]
on 19 Nov 2010 at 4:34
from mybatisnet.
Related Issues (20)
- Patch for /trunk/src/MyBatis.DataMapper/Configuration/Interpreters/Config/Xml/Processor/Handlers/ProcessStatementElement.cs
- Why not use BindingFlags.IgnoreCase
- Huge results - want to iterate myself. HOT 1
- Concurrency and SQL Injection HOT 1
- Loading dynamic assemblies fails with 'System.NotSupportedException' HOT 1
- mybatisnet invoke mysql procedure error
- How to get Table Columns using ibatis HOT 2
- There is no Get member named 'Wrapper' in class 'List`1' HOT 2
- Dynamic insert columns and values using mybatis
- Include tag with sql statement
- How to send string inside Sql tags HOT 1
- for each statement not working
- 很久都没发布版本了,希望能加快发布版本的步伐
- generate tag error
- sqlite :String was not recognized as a valid DateTime.
- how can i create temp table in ms-sql
- the newest source code (3.0) cannot build HOT 2
- AllowPartiallyTrustedCallers
- Unable to load embedded resource from assembly "MyBatis.SqlMap.config, MyBatis". HOT 2
- there no ibatis&mybatis for spring.net driver
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from mybatisnet.