Kunaal A Trehan

Ranch Hand
+ Follow
since Feb 04, 2004
Cows and Likes
Cows
Total received
0
In last 30 days
0
Total given
0
Likes
Total received
0
Received in last 30 days
0
Total given
0
Given in last 30 days
0
Forums and Threads
Scavenger Hunt
expand Ranch Hand Scavenger Hunt
expand Greenhorn Scavenger Hunt

Recent posts by Kunaal A Trehan

Hi

It would be great if some one can provide me a use case where
inner classes are inevitable.

I am of view that inner classes are not neccessay.
Why we should tie one class with the nclosing instance.

Thanks
Kunaal A Trehan
11 years ago
Hi All

I am using spring's declartive transaction mechanism
I am trying to insert 2 rows .One row is fine
But other row has null field in not null column

When I am trying to insert it ,first row gets inserted
But other row does not because of bad data
However whole trnsaction shd be rollback

Here is the code snippet
==========================================
public class TradeDAOImpl extends HibernateDaoSupport
{
public void saveTrade(IProduct iProduct) {

Session session = null;

IProduct temp=new Swap();
temp.setIsSwapswire(new Boolean(false));
temp.setManualTicketYN(new Boolean(false));
temp.setProductId(null);
temp.setTradeFeedTypeId(iProduct.getTradeFeedTypeI d());
temp.setTradeId(iProduct.getTradeId());
temp.setTraderGroupId(iProduct.getTraderGroupId()) ;


session=getSession();

try{
session.save(iProduct);//THIS DATA IS FINE
session.save(temp);//WRONG DATA
}catch(HibernateException ex)
{
ex.printStackTrace();
throw convertHibernateAccessException(ex);
}
finally{
session.close();
}
}
========

Here is my config file details
<bean id="myTxManager" class="org.springframework.transaction.jta.WebLogi cJtaTransactionManager"/>

<bean id="myTransactionFactory" class="org.springframework.transaction.interceptor .TransactionProxyFactoryBean">
<property name="transactionManager" ref="myTxManager"/>
<property name="target" ref="hibernate.tradeDAO"/>
<property name="transactionAttributes">
<props>
<prop key="saveTrade*">PROPAGATION_REQUIRED,-HibernateException</prop>
<prop key="update*">PROPAGATION_REQUIRED,-HibernateException</prop>
<prop key="*">PROPAGATION_REQUIRED,readOnly,-HibernateException</prop>
</props>
</property>
</bean>

<bean id="myDataSource" class="org.springframework.jndi.JndiObjectFactoryB ean">
<property name="jndiName" value="EblotterDS"/>
</bean>



Plz help me as I am stuck in this
Thnx
Kunal
Hi All
I am working on a project in which finally client will download the application using web start.Since for fetching data we need to connect to SQL server.We want to use windows authentication for connecting to SQL Server.
We are using hibernate to connect to DB.
Can any one help me out in this issue.

Thnx
Kunal
Hi

Put j2ee.jar or weblogic.jar in the classpath

It shd work

Kunal
Hi

Please go thru Head First EJB or Mastering EJB

It will help u


Kunal
Hi Saran

Basically when u try to send the message from the .war file.
Initial Context and other stuff is taken care as ure working
in the same env.
However when u re using remote client u need to specific where exactly it
shd do the look up.

Moreover when u re sending message to the Foriegn JMS Server.
Basically u re sending message to a local queue
which internally is mapped to remote machine.
This facility is provided in Weblogic.

I think it clarifies u how exactly look up and other thing happens

Kunal
Hi All

Can anyone explain me where exactly we can use EJBHandle?
Whts extra does it provide besides removing the lookup
logic??

Cheers
Kunal
Hi

Do one thing create a jar of our EJB files
and put that in classpath

I feel it shd work

Kunal
Hi

Consider a case
-class B extends A

Class A implements Serializable .But class B does not
Can class B be serialized?

Consider the same case.But Class B implements Serializable.
But class A does not implement Serializable.
Can class B be serialized?

Any pointers would be helpful

Cheers
Kunal
13 years ago
Hi
If u catch exception superclass u wud be able to
catch runtime exception also

Cheers
Kunal
Hi All,

Where exactly do we state isolation levels for entity beans?
I could not figure out.

Lets suppose I want to change the isolation level for my entity beans(CMP) from READ COMMITED to SERIALIZABLE

Where exactly I shd do this change

Cheers
Kunal
Thnx alot
I got the answer
Its better to look in JavaDocs first and then post a msg on forum
Hi

I have been asked this question in an interview.It has 2 parts
i)Can we load drivers for SQL Server and Oracle in one class?
ii)If we can do the above operation,how will driver manager come to know
which connection it shd return when u call DriverManager.getConnection();

This question may be silly for some
Any info on this will be appreciated..


Kunal
Hi All,

I would like to know why we have home and remote interfaces in EJB.
Can't we achieve the same functionality with a single class?

Is there a particular reason why these interfaces were introduced in EJB.

Cheers
Kunal