spring

Simple file upload using Flex UI and Spring/Hibernate/BlazeDS backend?

I'm new to Flex and BlazeDS and I'm trying to implement a simple application which uses Flex on the front end and a Spring/Hibernate application on the back end, with communication between the two going over a BlazeDS channel. I'm seeking direction as to the best and/or simplest way to approach this. I have the UI set up in such a way ...

Spring Jdbc atomicity with alter table

I'm trying to write an equivalent of Rails data model evolution/rollback mechanism using Spring Jdbc. Spring Jdbc transactionnal insert/replace works very well (DataSourceTransactionManager with PROPAGATION_REQUIRED under InnoDB mysql 5) : // Transaction begins getJdbcTemplate().execute("replace into aTable ..."); getJdbcTemplate().exe...

Spring and Spring MVC 3.0 AJAX Intergration

Except for this article http://blog.springsource.com/2010/01/25/ajax-simplifications-in-spring-3-0/ I cannot find any good examples of the new AJAX related features in Spring 3.0. I am interested in how the web application build utilizing Spring MVC with Annotations can be integrated with the various AJAX frameworks, such as Dojo to pro...

Spring MVC 3.0 with Annnotations performance tuning

Spring MVC 3.0 with Annotation seems like a great framework for the enterprise web development. However, the issue of performance tuning often comes up when you deal with any web applications, and I am wondering how the use of Annotations affects the strategy for improving performance. For example, would the Annotation-based validations ...

Using a Hibernate Session (Hibernate 3.2, Spring 2.0) to prevent idle transactions

We are using Spring 2.0, Hibernate 3.2, and PostgreSQL 8.4.2 with pgBouncer (we've also tried pgPool-II). We are occasionally getting "IDLE in transaction" queries which sit around and hang up our database ... they usually show up sometime in between 2:00am and 6:45am. I've been running into a lot of conflicting information online as t...

Should I care about Open Session in View when using Grails?

From my experience of using spring MVC in conjunction with hibernate I know about lazy exception problem occured when addressing to lazy-fetched collection when rendering view. It pure spring+hibernate world it fixes by introducing OpenSessionInViewInterceptor or OpenSessionInViewFilter thus enabling one hibernate session per request. S...

All @Resource injection before any @PostConstruct again.

JSR-250 says all @Resource annotated methods will be called before the @PostConstruct method.. My question is: Does that mean that all @Resource annotated methods on all beans in a context will be called before any @PostConstruct annotated methods are called? Or in other words can a beans @PostConstruct method be called once its depend...

UnexpectedRollbackException overrides my own exception

I have the following strange scenario with spring's transaction management: I have method A which calls method B which calls method C, each of them in a different class. Methods B and C are both wrapped with transactions. Both use PROPAGATION_REQUIRED, so while spring creates two logical transactions, there is one physical transaction i...

how to pass cursor as IN parameter to a stored procedure

Hi, I want to pass a cursor to a stored procedure as IN parameter from my xyz.java file. I am using spring and hibernate. Can you help me with this. Needed urgently.Reply soon. And if cannot pass then can you help with some alernative. Thankyou. ...

Spring - mvc ( SimpleFormController ) with hibernate database insertion.

I have made one example , In which I have used Spring - mvc and hibernate. I have successfully insert data in the database table but after that I have refresh the page new entry is inserted. Required Solution : When I refresh the page the database entry would not be inserted second time. ...

Spring Like clause

I am trying to use a MapSqlParameterSource to create a query using a Like clause. The code is something like this. The function containing it receives nameParam: String namecount = "SELECT count(*) FROM People WHERE LOWER(NAME) LIKE :pname "; String finalName= "'%" +nameParam.toLowerCase().trim() + "%'"; MapSqlParameterSource namedP...

A sample application in GWT + Spring + Hibernate

Hi, I've been thinking of using Spring + Hibernate with GWT, read a quite a few links on this topic but I'm not able to get started. So I'm looking for a sample application using GWT + Spring + Hibernate (at least Spring + GWT), could you please suggest any useful links !! Regards ...

Approach to validate form input against a data source (XML) in a Spring MVC app

I'm new to Spring, and I'm curious as to how to approach validating form input against a data source. I'm using Spring 3.0.3, by the way. So lets say I have the following form: public class MyForm { private String format; public String getFormat() { return format; } public void setFormat( value:String ) {...

How can I get the jndi name of the source of a jms message

Hello. I am using the Spring Session Aware Message Listener to listen to multiple JMS queues. Is there any way to get the JNDI name of the source of an incoming message? I have tried to use the getJMSDestination, but this only gives me the display name. Thank you. ...

Need help on learning java frameworks quickly

I wrote a piece of java code using threads, JDBC, Java Mail API etc. without using any of the frameworks (read Spring). I am frankly not too comfortable learning them first (lots of terminologies to remember!) and use them. So, please suggest me some ways to refine my existing code incorporating few of these framework concepts applicable...

How to create annotation-configured beans with an existing instance of @Configuration?

Assume we have a simple @Configuration: @Configuration public class FooBarConfiguration { @Bean public Foo createFoo() { return new FooImpl(); } @Bean @Autowired public Bar createBar(Foo foo) { return new BarImpl(foo); } } This class can be used with AnnotationConfigApplicationContext to p...

Session Beans and EJB3 vs Spring

I was curious about the capabilities of Sessions Beans in EJB 3 and whether they can be replaced in a typical mid-scale enterprise application with Spring. I found this article: http://drag0sd0g.blogspot.com/2010/01/session-bean-alternative-spring.html that states the following: "Because of heavy use of annotations, you can pretty much...

Spring/Struts 2 Configuration - any dummies' guide??

I'm a beginner in practical real-world java programming. I don't really understand these basic things in Spring - using it for jdbc calls (without any ORM), mail api, configuring logger. I think, I got a bit scared with the configurations (long, time-consuming) that're required to get these things working. Can anyone recommend dummies ...

question regarding mulitple entityManagerFactory in Spring 2.5.6

I am using Spring+JPA+Hibernate in my application. The issue I am facing is that I have multiple databases in my application and I have configured them correctly(I think) in the applicationContext.xml. Please refer to my applicationContext.xml below and tell me if: That's how I am supposed to configure the multiple databases If yes h...

Spring Portlet MVC and session objects

Hi there, I'm working on some portlets which I lay on Springs Portlet MVC framework. Now one question comes around: In these portlets I need some session objects (user info, etc) - to create this objects I was thinking of using a filter. My question is now: Do I have to declare my filter on normal webapp context (web.xml) or do I need t...