The dao manager does not parse it every time. It only parses once.
Is this documented somewhere? How does that work if my code is
telling the builder to build everytime a service request is made? Is
it cached somewhere in memory much like the hand made singleton class
I am using? I don't want
You will notice that your DaoManager only performs a buildDaoManager
when the DaoManager instance variable of your DaoManagerLoader is
null. After that it will simply return the existing DaoManager. It is
the responsibility of the developer to make sure it is loaded only
once. If you did not
DAO Loading dao.xml
The dao manager does not parse it every time. It only parses once.
Is this documented somewhere? How does that work if my code is
telling the builder to build everytime a service request is made? Is
it cached somewhere in memory much like the hand made singleton class
I
..
The initSystem calls methods to setup my cache...
-Original Message-
From: Ron Grabowski [mailto:[EMAIL PROTECTED]
Sent: Monday, May 02, 2005 1:04 PM
To: ibatis-user-java@incubator.apache.org
Subject: RE: iBatis DAO Loading dao.xml
Calls to buildDaoManager resolve to this class:
http
PROTECTED]
Sent: Monday, May 02, 2005 1:04 PM
To: ibatis-user-java@incubator.apache.org
Subject: RE: iBatis DAO Loading dao.xml
Calls to buildDaoManager resolve to this class:
http://tinyurl.com/9qymm
http://svn.apache.org/repos/asf/incubator/ibatis/trunk/java/mapper/mapper2/s
rc/com
it..
-Original Message-
From: Brandon Goodin [mailto:[EMAIL PROTECTED]
Sent: Monday, May 02, 2005 1:35 PM
To: ibatis-user-java@incubator.apache.org
Subject: Re: iBatis DAO Loading dao.xml
Why are you mingling iBatis with the servlet layer? Initialization
would be better placed in the service layer
it..
-Original Message-
From: Brandon Goodin [mailto:[EMAIL PROTECTED]
Sent: Monday, May 02, 2005 1:35 PM
To: ibatis-user-java@incubator.apache.org
Subject: Re: iBatis DAO Loading dao.xml
Why are you mingling iBatis with the servlet layer? Initialization
would be better placed
S, you are saying that calling DaoManager.buildDaoManager alone
will parse the dao.xml every single time?? Which is it? It does or
it doesn't. I've got conflicting answers here now. I guess I'll just
break down and look at the source code for that static method.
On 5/2/05, Brandon
Ok, looking at the source would tell me that DaoManagerBuilder by
itself will parse the XML file every single time it is called. So you
have to manually check to see if the daoManager instance is null or
not and provide the appropriate action accordingly. So the following
statement is false:
Hi Gregg,
The dao manager does not parse it every time. It only parses once.
Also, I would do things a bit different than you are doing. I would
not place the dao in my base service class. I would use a DaoConfig
class that holds the DaoManager reference as an static final instance
variable. I
Saw a typo! oopsie :-)
I would not place the dao in my base service class.
Should be:
I would not place the dao manager in my base service class.
On 5/1/05, Brandon Goodin [EMAIL PROTECTED] wrote:
Hi Gregg,
The dao manager does not parse it every time. It only parses once.
Also, I would
Thanks for the reply. I actually did something similar to this before
I saw your response. I made the following class
DaoManagerLoader.java
public class DaoManagerLoader {
public static final String DAO_XML_PATH =
com/intrust/anykey/database/dao/iBatis/dao.xml;
public static DaoManager
It would be perfectly fine to instantiate the Service class in your
web layer. But, you might want to follow a similar pattern as the
service layer does with the Dao classes. Instantiate your service
classes in the constructor and assign them to instance variables in
your Servlet, Action(Struts)
13 matches
Mail list logo