This week's book giveaways are in the Jython/Python and Object-Oriented programming forums.
We're giving away four copies each of Machine Learning for Business: Using Amazon SageMaker and Jupyter and Object Design Style Guide and have the authors on-line!
See this thread and this one for details.
Win a copy of Machine Learning for Business: Using Amazon SageMaker and JupyterE this week in the Jython/Python forum
or Object Design Style Guide in the Object-Oriented programming forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Bear Bibeault
  • Paul Clapham
  • Jeanne Boyarsky
  • Knute Snortum
Sheriffs:
  • Liutauras Vilda
  • Tim Cooke
  • Junilu Lacar
Saloon Keepers:
  • Ron McLeod
  • Stephan van Hulst
  • Tim Moores
  • Tim Holloway
  • Carey Brown
Bartenders:
  • Joe Ess
  • salvin francis
  • fred rosenberger

Issue with DAO using Spring - Write operations not allowed in read-only mode

 
Greenhorn
Posts: 11
  • Likes 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
HTTP Status 500 - Request processing failed; nested exception is org.springframework.dao.InvalidDataAccessApiUsageException: Write operations are not allowed in read-only mode (FlushMode.MANUAL): Turn your Session into FlushMode.COMMIT/AUTO or remove 'readOnly' marker from transaction definition.
these are my files

LoginController.java


RegisterDao.java



RegisterDaoImpl.java



spring-servlet.xml


web.xml



pom.xml

 
Sheriff
Posts: 9671
42
Android Google Web Toolkit Hibernate IntelliJ IDE Spring Java
  • Likes 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Can you add more details like which request gives you this error. Few lines of the stack trace might also be helpful. One possible issue is that you've marked your DAO as a @Service, but DAOs are supposed to be @Repository...
 
Nagaraju Boddu
Greenhorn
Posts: 11
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
thank you for your replay.... i am getting this error while submitting values to database to store..... when i try to call dao.adduser() method in dao class am getting that error...
 
Nagaraju Boddu
Greenhorn
Posts: 11
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
thank you @Ankit Garg... i tried by @Repository annotation but it is also showing same error
 
Ankit Garg
Sheriff
Posts: 9671
42
Android Google Web Toolkit Hibernate IntelliJ IDE Spring Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You've included <tx:annotation-driven transaction-manager="transactionManager" /> but I don't see the transactionManager bean declared. Can you declare a transaction manager bean and try...
 
Nagaraju Boddu
Greenhorn
Posts: 11
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
i tried but getting error as

> > java.lang.IllegalStateException: Already value [org.springframework.orm.hibernate5.SessionHolder@19037196] for key [org.hibernate.internal.SessionFactoryImpl@1a513405] bound to thread [http-bio-2016-exec-5]
> java.lang.IllegalStateException: No value for key [org.hibernate.internal.SessionFactoryImpl@1a513405] bound to thread [http-bio-2016-exec-5]
 
Ankit Garg
Sheriff
Posts: 9671
42
Android Google Web Toolkit Hibernate IntelliJ IDE Spring Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
This other thread you created seems very similar to the problem you are facing here (apart from the database everything else seems to be the same). I'm getting a bit confused, are you facing the same issue in both projects? If yes it would be better to focus on one of them so that it is easier to resolve the issue...
 
Politics n. Poly "many" + ticks "blood sucking insects". Tiny ad:
Java file APIs (DOC, XLS, PDF, and many more)
https://products.aspose.com/total/java
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!