Lisa Ray

Greenhorn
+ Follow
since Mar 05, 2009
Merit badge: grant badges
For More
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 Lisa Ray

Do you commit your transaction


Why is there a need to commit the transaction explicitly?
I'm annotating the caller of the DAO with @Transaction; by default it used the REQUIRED transaction attribute.

Hi Ranchers,
I'm not sure if this is really a Spring issue or Hibernate ORM problem. I changed the transaction strategy to use AOP, as shown below:


Now even with the new changes in place, I get the following error:







- Lisa
Hi Nathan, Thanks for the post. For the sake of brevity I didn't post the entire app context XML. Here's the Spring XML:




I'm sure that the beans have been wired correctly, else I would have got a fat parser error. The only concern is that the service layer is not wrapped in a transaction. Because of which I get the following exception from the DAO layer:


Thanks
Lisa
Hi All,
I'm using annotation-based Spring 2.5 in my service layer. The service calls DAO. It seems that service is not wrapped in a transaction which causes the Hibernate DAO to fail.

My Configuration file looks like this:



Following is the Service impl class:




Please suggest in case I'm missing something here.


Thanks
Lisa
Hi All,
I'm unit testing a Hibernate app. The POJOs and mappings are in a JAR while placed in my app classpath. My Junit calls a Service which starts a new transaction to talk to the DAO in order to and perform any CRUD operations. The DAO is implemented using Spring Hibernate template. I'm taking care to inject a template into the DAO...there are no wiring exceptions at all.


My service can read data from the DAO. However, the problem is with insert.

Consider the code snippet taken from the DAO.


On the console I can see SELECT queries (called as a result of template.find() calls). But, I can't see any INSERT SQL statements when I call DAO.save method.
Any help shall be highly appreciated.

Thanks
Lisa
Hi Peter,
Thanks for posting.

JavaRanch rocks!

I had to make two changes to get it working:

1. Add qdox 1.6 JAR to ANT
2. Tweak the attribute compiler task:


Thanks
Lisa

14 years ago
Hi All,
I'm facing a strange issue while compiling an app which uses Java 5 annotations. I'm tried with JDK 5 and JDK 6 and Apacha Ant 1.7. I get the following error while executing ant either from Eclipse or command line.



My ANT_HOME is set to C:\Tools\apache-ant-1.7.1
JAVA_HOME is set to C:\Program Files\Java\jdk1.5.0_09

Further, I tried using the following options with the javac task:




Any help shall be highly appreciated.

Thanks
Lisa
14 years ago
Hi,
I'm trying to deploy an EAR file through Apache ANT build script on WLS 9.2. The WLS is running. I can successfully deploy the EAR file by manually copying the file in the autodeploy folder of my domain. However, I get the following error when I try to do the same from ANT build:



Am I missing out something here?

Thanks
Lisa
14 years ago
Hi Ranchers,
I found a very useful DB logging tool which is bundled with WLS. Read the BEA doc.

http://download.oracle.com/docs/cd/E12840_01/wls/docs103/jdbc_drivers/spy.html


However, the log output produces for Hibernate queries is the same as the output produced by Hibernate logger. It shows all placeholders with ? not the actual vales. Is there any way to configure the same??


- Lisa
Just to add, Hibernate doesn't compete with EJB 3 JPA sub-spec. It provides an implementation called Entity Manager.
Hi All,
I've a DB table which has several columns. Hibernate can't update a DB row when a nullable column is null and through code I try to set it to a legal non-null value. That said, if the nullable column has a legal vale, Hibernate successfully updates its value. I can see the Hibernate generated UPDATE SQL in the log. Furthermore, while updating a nullable column which is null, Spring's Hibernate template doesn't return from saveOrUpdate() method call. In the log there's no exception. Seems like the exception is gets lost. Did anyone face the same issue?

Here's how it looks in code.


Service Layer


DAO Layer



What's happening here?
When I try to debug the app, it's strange to note that the control disappears after the saveOrUpdate call. The control never returns from the save method. Also, in the log file I can't see any exception propagated.


Thanks
Lisa
Hi Paul,

Thanks for the reply. I think I've got answers to my questions.

Just to add, I think I can use dynamic-update attribute in Hibernate mapping file to avoid updating every possible column.


Thanks
Lisa
Hi,
I'm using Hibernate ORM 3. I have two queries:
1. Is there a tool which shows the exact native SQL that Hibernate Generates. If we turn on show-sql, it displays SQL but with placeholders like ?.

2. By default saveOrUpdate() or update() tries to update every possible column in the DB even though just a single column changed. This is not the best performance strategy. Is there a workaround?

Thanks
Lisa
Hi All,
I'm facing a weird issue with WLS 9.2. Whenever I create a DataSource or a JMS resource like a Queue, it's successfully created. However when I try to view the JNDI tree it's not there!


Any help shall be highly appreciated.

Thanks
Lisa
14 years ago
Hi All,
I'm trying to deploy an EAR file using Ant. I'm using WLS 9.2 with Java 5.

Please note that when I deploy the ear in exploded format from the WLS it works fine. However when I try to do the same from an ant build script it thows a weird exception, as shown below:




Any help shall be highly appreciated!

Thanks
Lisa
14 years ago