aspose file tools*
The moose likes Spring and the fly likes persist data Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of EJB 3 in Action this week in the EJB and other Java EE Technologies forum!
JavaRanch » Java Forums » Frameworks » Spring
Bookmark "persist data" Watch "persist data" New topic
Author

persist data

Arian Zand
Greenhorn

Joined: May 28, 2012
Posts: 9
Hi,
A few weeks ago I posted my problem I could not persist my records.
I still have this problem but I fixed some errors.

I have a Form with a few textboxes to make a reservation for a hotel.
It's need your name,firstame, arrival etc...

When I press on my save button it doesnt persist and i dont know why

I put some system.outprintlns to check my function does receive the parameters and it does ....

I worked on this way:

My Reservationcontroller



My ReservationDao



My controllerImplementation



My domain



My view



Thanks!
Mark Spritzler
ranger
Sheriff

Joined: Feb 05, 2001
Posts: 17249
    
    6

OK, so you are saying your Reservation parameter in your Controller POST method is being populated.

You see your printlns show in the console.

Now what about setting a break point? can you do debugging? The thing we have to check is to see if you have a Transaction. If you can set a break point in the first line of your controller method. Then look at the Controller's Dao reference. If in the debugger it says it is being Proxied, then you have a Proxy.

Basically the code looks fine, although I didn't take a fined tooth comb to it.

The other thing you should post is your configuration of your EntityManagerFactory, and also your TransactionManager configuration as well as your DataSource. Also you have <tx:annotation-driven/> in your config?

Mark


Perfect World Programming, LLC - Two Laptop Bag - Tube Organizer
How to Ask Questions the Smart Way FAQ
Arian Zand
Greenhorn

Joined: May 28, 2012
Posts: 9
Mark Spritzler wrote:OK, so you are saying your Reservation parameter in your Controller POST method is being populated.

You see your printlns show in the console.

Now what about setting a break point? can you do debugging? The thing we have to check is to see if you have a Transaction. If you can set a break point in the first line of your controller method. Then look at the Controller's Dao reference. If in the debugger it says it is being Proxied, then you have a Proxy.

Basically the code looks fine, although I didn't take a fined tooth comb to it.

The other thing you should post is your configuration of your EntityManagerFactory, and also your TransactionManager configuration as well as your DataSource. Also you have <tx:annotation-driven/> in your config?

Mark


Hi Mark, Thanks for your reply

How can I set break points in java?
Sorry I'm a newbie in Java...

In My servlet-Context I config my Entity manager (I set my annotation driven in comment because otherwise i get an error of Element of attribute dont match I need to set a xmlns but i dont know which one:

Arian Zand
Greenhorn

Joined: May 28, 2012
Posts: 9
PROBLEM SOLVED
I forget adding my xlmns schema and location for my transaction manager
Bill Gorder
Bartender

Joined: Mar 07, 2010
Posts: 1632
    
    7

Glad you got that solved. Just a word of caution the following 2 lines probably do not behave the way you think:



Merge is different then persist in that it returns the managed entity which may not be the one you passed in. What you probably mean to do is:



[How To Ask Questions][Read before you PM me]
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: persist data
 
Similar Threads
Insert In SpringMVC
help getting user supplied dates to display
Exception in thread "main" org.hibernate.exception.SQLGrammarException: could not execute query
Spring 3 form validation
how can i display my data on jsp page