sreelakshmi sarma

Ranch Hand
+ Follow
since Mar 02, 2000
Merit badge: grant badges
For More
Cows and Likes
Cows
Total received
In last 30 days
0
Forums and Threads

Recent posts by sreelakshmi sarma

Could somebody please give me a reply. I have a deadline and I am hoping that you guys will throw some light about this.

Thanks a lot.
15 years ago
Hi All,

We have a requirement in our project to provide more user friendly error messages when ever a sql exception occurs in the data zone. In order to implement this we have decided to use Spring Database Exception handling. Currently our data zone is implemented using MDB and iBatis for data access. MDB is defined as CMT so i would just like to use spring-ibatis so i can take advantage of spring DataAccessException heirarchy and using Spring AOP for iBatis DAO initialization. My question now is how do i make sure that trasactions are managed by the container and spring doesn't interfere with the transaction management. Again i do want to use Spring transaction management just use spring for other purposes. Is it possible to configure spring in such a way?

This is how i have configured my spring and ibatis config files. Is this the right way of configuring it?

spring-dao.xml


<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd">

<!-- DataSource -->
<bean id="dataSource"
class="org.springframework.jndi.JndiObjectFactoryBean">
<property name="jndiName" value="java:comp/env/jdbc/dbids" />
<property name="lookupOnStartup" value="false" />
<property name="cache" value="true" />
<property name="proxyInterface" value="javax.sql.DataSource" />
</bean>


<!-- SqlMap Client -->
<bean id="sqlMapClient"
class="org.springframework.orm.ibatis.SqlMapClientFactoryBean">
<property name="configLocation">
<value>classpath:sql-map-config.xml</value>
</property>
<property name="dataSource">
<ref bean="dataSource" />
</property>
</bean>

<!-- SqlMap Client Template -->
<bean id="sqlMapClientTemplate"
class="org.springframework.orm.ibatis.SqlMapClientTemplate">
<property name="sqlMapClient">
<ref bean="sqlMapClient" />
</property>
</bean>

<bean id="abstractDao" abstract="true">
<property name="sqlMapClient">
<ref bean="sqlMapClient" />
</property>

<property name="exceptionTranslator">
<bean
class="gov.hhs.cms.dbids.dz.persistence.spring.DBidSSqlErrorCodeExceptionTranslator">
<property name="dataSource" ref="dataSource" />
</bean>
</property>

</bean>

<bean id="gov.hhs.cms.dbids.dto.bid.BidTO"
class="gov.hhs.cms.dbids.dz.persistence.ibatis.bid.BidDAO"
parent="abstractDao" />
<bean id="gov.hhs.cms.dbids.bo.bid.BidItem"
class="gov.hhs.cms.dbids.dz.persistence.ibatis.bid.BidItemDAO"
parent="abstractDao" />
<bean id="gov.hhs.cms.dbids.bo.bid.County"
class="gov.hhs.cms.dbids.dz.persistence.ibatis.bid.CountyDAO"
parent="abstractDao" />
<bean id="gov.hhs.cms.dbids.bo.audit.BidAudit"
class="gov.hhs.cms.dbids.dz.persistence.ibatis.audit.BidAuditDAO"
parent="abstractDao" />
<bean id="gov.hhs.cms.dbids.bo.bid.SubContractor"
class="gov.hhs.cms.dbids.dz.persistence.ibatis.bid.SubContractorDAO"
parent="abstractDao" />
<bean id="gov.hhs.cms.dbids.bo.bid.TopItem"
class="gov.hhs.cms.dbids.dz.persistence.ibatis.bid.TopItemDAO"
parent="abstractDao" />
<bean id="gov.hhs.cms.dbids.bo.bid.Model"
class="gov.hhs.cms.dbids.dz.persistence.ibatis.bid.ModelDAO"
parent="abstractDao" />
<bean id="gov.hhs.cms.dbids.dto.bidder.LocationTO"
class="gov.hhs.cms.dbids.dz.persistence.ibatis.bidder.LocationDAO"
parent="abstractDao" />
<bean id="gov.hhs.cms.dbids.bo.bidder.CBALocation"
class="gov.hhs.cms.dbids.dz.persistence.ibatis.bidder.LocationCBADAO"
parent="abstractDao" />
<bean id="gov.hhs.cms.dbids.dto.bidder.SupplierTO"
class="gov.hhs.cms.dbids.dz.persistence.ibatis.bidder.SupplierDAO"
parent="abstractDao" />
<bean id="gov.hhs.cms.dbids.dto.bidder.BidderTO"
class="gov.hhs.cms.dbids.dz.persistence.ibatis.bidder.BidderDAO"
parent="abstractDao" />
<bean id="gov.hhs.cms.dbids.bo.bidder.ContactPerson"
class="gov.hhs.cms.dbids.dz.persistence.ibatis.bidder.ContactPersonDAO"
parent="abstractDao" />
<bean id="gov.hhs.cms.dbids.bo.bidder.KeyPerson"
class="gov.hhs.cms.dbids.dz.persistence.ibatis.bidder.KeyPersonDAO"
parent="abstractDao" />
<bean id="gov.hhs.cms.dbids.bo.bidder.Accreditation"
class="gov.hhs.cms.dbids.dz.persistence.ibatis.bidder.AccreditationDAO"
parent="abstractDao" />
<bean id="gov.hhs.cms.dbids.bo.bidder.AccreditationProductClass"
class="gov.hhs.cms.dbids.dz.persistence.ibatis.bidder.AccreditationProductClassDAO"
parent="abstractDao" />
<bean id="gov.hhs.cms.dbids.bo.bidder.BidderCBA"
class="gov.hhs.cms.dbids.dz.persistence.ibatis.bidder.BidderCBADAO"
parent="abstractDao" />
<bean id="gov.hhs.cms.dbids.bo.bidder.BidderPC"
class="gov.hhs.cms.dbids.dz.persistence.ibatis.bidder.BidderPCDAO"
parent="abstractDao" />
<bean id="gov.hhs.cms.dbids.bo.audit.BidderAudit"
class="gov.hhs.cms.dbids.dz.persistence.ibatis.audit.BidderAuditDAO"
parent="abstractDao" />
<bean id="gov.hhs.cms.dbids.reference.BidCycle"
class="gov.hhs.cms.dbids.dz.persistence.ibatis.reference.BidCycleDAO"
parent="abstractDao" />
<bean id="ReferenceDAO"
class="gov.hhs.cms.dbids.dz.persistence.ibatis.reference.ReferenceDAO"
parent="abstractDao" />
<bean id="StatusDAO"
class="gov.hhs.cms.dbids.dz.persistence.ibatis.status.DBidsStatusDAO"
parent="abstractDao" />
<bean id="LockDAO"
class="gov.hhs.cms.dbids.dz.persistence.ibatis.LockDAO"
parent="abstractDao" />
<bean id="NSCValidationDAO"
class="gov.hhs.cms.dbids.dz.persistence.ibatis.NSCValidationDAO"
parent="abstractDao" />


</beans>

sql-map-config.xml

<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!DOCTYPE sqlMapConfig
PUBLIC "-//iBATIS.com//DTD SQL Map Config 2.0//EN"
"http://www.ibatis.com/dtd/sql-map-config-2.dtd">
<!--============================================================================
= DBids iBATIS SQL Maps Configuration =
= =
= @Author: DBids Team, dbidstech@maricom.com =
= @Date: April 12, 2008. =
==========================================================================-->
<sqlMapConfig>
<settings cacheModelsEnabled="false"
statementCachingEnabled="false"
enhancementEnabled="true"
maxSessions="1485"
maxTransactions="594"
maxRequests="5940"
useStatementNamespaces="false"/>
<!--===============================================
SQL Map resources
===============================================-->
<!-- Adding the transactionmanager to eliminate Spring transaction mgmt and depend on EJB CMT -->
<!-- Commented this out to test Spring-iBatis Integration -->
<transactionManager type="EXTERNAL">
<property name="UserTransaction" value="java:comp/env/UserTransaction" />
<dataSource type="JNDI">
<property name="DataSource" value="java:comp/env/jdbc/dbids" />
</dataSource>
</transactionManager>



<sqlMap resource="sql/Model.xml"/>
<sqlMap resource="sql/County.xml"/>
<sqlMap resource="sql/Bid.xml"/>
<sqlMap resource="sql/SubContractor.xml"/>
<sqlMap resource="sql/TopItem.xml"/>
<sqlMap resource="sql/BidItem.xml"/>
<sqlMap resource="sql/User.xml"/>
<sqlMap resource="sql/county_ref.xml"/>
<sqlMap resource="sql/cba_ref.xml"/>
<sqlMap resource="sql/acc_agency_ref.xml"/>
<sqlMap resource="sql/acc_prod_ref.xml"/>
<sqlMap resource="sql/nsc_ref.xml"/>
<sqlMap resource="sql/product_ref.xml"/>
<sqlMap resource="sql/pc_ref.xml"/>
<sqlMap resource="sql/state_ref.xml"/>
<sqlMap resource="sql/org_type_ref.xml"/>
<sqlMap resource="sql/bid_cycle_ref.xml"/>
<sqlMap resource="sql/bidder_type_ref.xml"/>
<sqlMap resource="sql/privilege_ref.xml"/>
<sqlMap resource="sql/role_ref.xml"/>
<sqlMap resource="sql/bidder_status_ref.xml"/>
<sqlMap resource="sql/bid_status_ref.xml"/>
<sqlMap resource="sql/acc_status_ref.xml"/>
<sqlMap resource="sql/prod_customer_ref.xml"/>
<sqlMap resource="sql/prod_revenue_ref.xml"/>
<sqlMap resource="sql/medi_area_ref.xml"/>
<sqlMap resource="sql/medi_customer_ref.xml"/>
<sqlMap resource="sql/medi_revenue_ref.xml"/>

<sqlMap resource="sql/Location.xml"/>
<sqlMap resource="sql/LocationCBAPC.xml"/>
<sqlMap resource="sql/KeyPerson.xml"/>
<sqlMap resource="sql/ContactPerson.xml"/>
<sqlMap resource="sql/Supplier.xml"/>
<sqlMap resource="sql/BidderCBA.xml"/>
<sqlMap resource="sql/BidderCBAPC.xml"/>
<sqlMap resource="sql/Bidder.xml"/>
<sqlMap resource="sql/Accreditation.xml"/>
<sqlMap resource="sql/AccProductClass.xml"/>
<sqlMap resource="sql/status.xml"/>
<sqlMap resource="sql/lock.xml"/>
<sqlMap resource="sql/BidAudit.xml"/>
<sqlMap resource="sql/BidderAudit.xml"/>
<sqlMap resource="sql/NSC.xml"/>


</sqlMapConfig>

Thanks for reading my post. I would really appreciate it if someone could throw some light on this.

Thanks,
Sree

15 years ago
Hi,
Could somebody please explain me what an application server is and what a web server is. The differences between these two.
Thanks A Lot
sree.
24 years ago
Congratulations!!! Ajith
Ejb
Thanks Tony,Tom,Vladan,Lucy & Umesh.
Ejb
Could somebody please suggest me a good beginners book to start with Ejb.
Thanks.
Ajith,Satya,Suma,Herbert,Suresh,Eric,Veena,Nirvan,Edward Thank you very much. And also sorry for the late reply. I was out of town. Herbert if you are thorough with the basics and if you are doing good with all the mock exams(especially in Marcus mock exams if you are getting above 80%)then you have nothing to worry about the real test. Believe me the real test is damn easy. You will definitely do good. Satya & Edward my special thanks to you guys for taking time to answer my last minute doubts. Veena thanks a lot for all the help you have given.I really appreciate it. Once again thanks to you all.
Good Luck!!!
Today i cleared SCJP with 88%. My special thanks to Maha & Jim. The test was easy. I should have taken it one month back. I thought i answered all q's correctly and was hoping for above 90%.It's little disappointing.I must have made some careless mistakes.I didn't get any ambigous q's. The test was pretty straight forward. I got only one easy q from collections and two q's in I/O asking about constructors.G.C theory q i think i got it wrong.Marcus mock exams were helpful. The difficulty level is the same as the real test.For the past three months checking out this site has become part of my daily routine. Infact i am addicted to this site.I can't stop visiting javaranch.Thanks every one.
Good Luck!!!
Thanks all for your responses. Actually i scheduled my test for today. But had to postpone that due to personal reasons. But will be giving by the end of this week. I want to finish this asap tired of cramming basics.

Thank you very much.
Choose the correct statement about gridbag layout:
A.The weightx & weighty should have values between 0.0 & 1.0
B.If you specify the fill field is BOTH, there is no meaning to set anchor
field
C.If you specify anchor field there is no meaning to set fill field is BOTH
I think only B is true. Please confirm this.
A copy of the original event is passed into a listener method. true/false.i think it's false. Can anybody confirm this for me.

2)You can run the g.c when ever you want to.
True/False.
Thanks.

[This message has been edited by sree (edited May 16, 2000).]
I have some doubts regarding the real exam please help me.
1)If we get a q like write the name of the mwthod which schedules the thread or something like that. Then should we write start() or start or start();
2)Do we have include semicolon at the end of the code.For ex
How do you assign 0x30a0 to a char variable c.
Then should we write char c = '\u30a0'; or just '\u30a0'.
3)If they ask us how do you declare a class and they give something like private,public or whatever then should we include {}.
4)Do we have to include "" when we write something in the text field.
Please clarify asap.
Thanks.
please give me confirmation regarding this threads question.
What might cause the current thread to stop executing.
A. An InterruptedException is thrown. //I think it is false. The thread won't stop executing.
B. The thread executes a wait() call.//true
C. The thread constructs a new Thread.
D. A thread of higher priority becomes ready.//true
E. The thread executes a waitforID() call on a MediaTracker.//true
Thanks.
since addComponentlistener(), addKeyListener(),addMouseListener(),addMouseMotionListener() and addFocusListener() methods belong to the Component class all componenets can respond to the corresponding events right???
So, if i get a question like which components generate ComponentEvent and i have given choices like button,frame,textfield etc then i should choose everything that is a subclass of component right???
Please take time to clarify this for me.
Did anyone get which component generate which event type of q's.