I want to save the selected value of drop-down list into the database. First index.jsp is loaded. From index.jsp, we can go to register.jsp when we click register URL of index.jsp. struts.xml: index.jsp: register.jsp: Action class is: the drop down list is actually only one of the form fields. there are other…
Tag: hibernate
What is the difference between CascadeType.REMOVE and orphanRemoval in JPA?
What’s the difference between and This example is from Java EE Tutorial, but I still don’t understand details. Answer From here:- Cascading Remove Marking a reference field with CascadeType.REMOVE (or CascadeType.ALL, which includes REMOVE) indicates that remove operations should be cascaded autom…
Getting “Deadlock found when trying to get lock; try restarting transaction”
My Application(java spring-core) has several threads running concurrently and accessing db, I am getting exception in some peaktime My code looks Answer MySQL’s InnoDB engine sports row-level locking, which can lead to deadlocks even when your code is inserting or updating a single row (specially if the…
MySQL: Unknown system variable ‘tx_read_only’
I’m working on a Java Swing-based application+ Hibernate+Mysql+Spring. When I test CRUD operations, I don’t have problems with read, but in insert statements system shows the message: I have the last version of MySQl Hibernate 4 Java annotations Can you tell me which is the problem to solve now? A…
BCrypt.checkpw() Invalid salt version exception
I’m trying to implement authentication using BCrypt, in my Play 2.1. Java application, but I’m getting Invalid salt version exception when I’m trying to authenticate the user. This is my stack trace I’m using following maven repository: http://mvnrepository.com/artifact/org.mindrot/jbc…
Spring fails to inject entity manager factory
I writing tests for my DAO classes using JPA, with Hibernate as JPA provider, and Spring 3.2. I am not able to inject the entity manager correctly, I get a NullPointerException when trying to access it. My GenericDAO implementation looks like this: The class of the test looks like this: My root-context.xml is…
Hibernate Error: a different object with the same identifier value was already associated with the session
I essentially have some objects in this configuration (the real data model is a bit more complex): A has a many-to-many relationship with B. (B has inverse=”true”) B has a many-to-one relationship with C. (I have cascade set to “save-update”) C is a kind of type/category table. Also, I…
What’s the difference between JPA and Spring Data JPA?
I am a bit confused about the difference between Spring Data-JPA and JPA. I know about JPA that it is a specification for persisting the Java Objects to a relational database using popular ORM …
org.hibernate.hql.internal.ast.QuerySyntaxException: table is not mapped [from table]
I’m trying to learn to use Hibernate using MySQL, I’ve never worked with it before and after a chain of errors I finally get stucked with this: I’ve tried with possible solutions of another questions, but nothing, it doesn’t work. This is what I’ve done so far: hibernate.cfg.xml …
Hibernate faster EntityManagerFactory creation
In my desktop application new databases get opened quite often. I use Hibernate/JPA as an ORM. The problem is, creating the EntityManagerFactory is quite slow, taking about 5-6 Seconds on a fast machine. I know that the EntityManagerFactory is supposed to be heavyweight but this is just too slow for a desktop…