hibernate

bean userList not found within scope, after some test of login functionality with Jmeter.

I have a web app (using Hibernate, and I cannot avoid that because is one of the point of the exam test ) for a university project in wich I need a login functionality. After I run some test with Jmeter (basicaly http get e post in the login) I found that after 20 test the webapp stop working returning this message : bean userList not f...

i am using spring for hibernate only not as spring mvc and i am using jsf2.0 and now i need to implement AOP

Possible Duplicate: How to implement AOP with Spring i am using spring for hibernate only not as spring mvc and i am using jsf2.0 and now i need to implement AOP but I am not getting at what to do i am not following Spring MVC.. ...

What's the use of session.flush() in Hibernate

When we are updating a record, we can use session.flush() with Hibernate. What's the need for flush()? ...

Hibernate 3.5.1, JPA2.0 & MySQL - Alternate behaviour within 2 diff dbs / same server

I am running a MySQL 5.1 server and Hibernate 3.5.1 / JPA2 for ORM. Everthing seems fine until I drop some tables manually. From then on, unit tests fail with Hibernate no longer creating certain tables. Changing the jdbc url from url=jdbc:mysql://localhost:3306/dbjava?createDatabaseIfNotExist=true to url=jdbc:mysql://localhost:3306...

Execute DDL from hibernate

I know that SchemaExport should be my friend. But I am using liquibase and want to execute the DDL - pure sql statements - generated from liquibase to recreate the database before every test method. Do you see problems with the following code? I wonder that this seems to be so complicated ... public static int executeScript(String sqlF...

Hibernate one-to-many search with Criteria

Hi all, I've got a Hibernate entity, called Event, which has a one-to-many metadata entity, EventData. Given the following Event: EventId: 1 EventHash: broccoli With the following EventDatas: EventDataId: 1 EventId:1 Field: tag Content: tagme EventDataId: 2 EventId: 1 Field: tag Content: anotherTag How do I create a Criteria que...

Caching application data in Grails

Hi, in order to keep certain application variables I may need to change when the application is running without having to restart it, I'm thinking in implementing a Grails service and a Quartz job so every X minutes, the service reloads the entire "parameters" table - and I query the service for a parameter's value. Now, is this a good ...

cache collection in hibernate

Hi I have Company object and @OneToMany(fetch = FetchType.EAGER, cascade = { CascadeType.ALL }, mappedBy = "company") @Column(nullable = false) Set<User> getUsers() Do you recommend caching the getUsers collection performance wise? ...

Can't access lazy annotated but initialized hibernate collection from JSF2

I have a many-to-many relationship between the two entities called events and artists, both are annotated to be lazy loaded. When I load an artist, I initialize its events because the session will be closed afterwards using Hibernate.initialize(artist.getEvents()); A test in pure Java works fine and I can access the events and its pro...

Is it possible to generate a default value for a certain database column using hbm2ddl

Env: JPA 1, Hibernate 3.3.x, MySQL 5.x We auto generate database schema using hbm2ddl export operation. Would it be possible to generate a default value for a certain @Entity member during SQL generation. (e.g. archive field in mytable entity class. create table mytable ( ... 'archive‘ tinyint(1) default ’0 ’, ... ) ...

How we will access to the database from AuditTrailInterceptor?

Hi, I'm trying to access the database from Hibernate Interceptor (I need to audit only specific objects that are defined in a different table) and the access is impassable (I get exceptions). Is there a way to access database in interceptor? My AuditTrailInterceptor is: public class AuditTrailInterceptor extends EmptyInterceptor { ...

Prevent data from being deleted after test run with Hibernate / Spring / Maven / MySQL

Hi I am using Hibernate / Spring / Maven / MySQL and unit tests with JUnit. Up to yesterday, my testdata persisted in the database even after the test run was completed. I configured the hell out of this day and all of the sudden all data are being deleted after every test run. Quite sure, this is no bug, but a config issue. Nevertheles...

Hibernate Mappings for struts2

Hello guys, I am trying to build a login page using hibernate and struts2. My design is as follows. Each login user has a role. Many users can have the same role. So my class are: User.java @Entity @Table(name = "user", catalog = "ciner") public class User implements java.io.Serializable { private Integer userId; private Role r...

Hiberate / JPA -> Nullable values & objects?

Hi My basic question is: How can I force Hibernate to make float NULLable and accept NULL for float, datetime, blob, respectively? I really mean NULL, not (float) 0.0. Even worse, when I try to store an object with the desired NULLable fields actually being NULL and using entity manager, I get errors for attributes, which are marked as...

i am trying to use aop pointcut stuff for transaction but gettig error i am using hibernate too.

i am trying to use aop pointcut stuff for transaction but gettig error i am using hibernate too. I am following this : http://static.springsource.org/spring/docs/2.5.x/reference/transaction.html Before that i was using hibernate+spring sessionFactory and all that.. Error : WARNING: java.lang.IllegalStateException: ContainerBase.addCh...

Hibernate Session Connection Relationship

How many connection will hold for a single hibernate session where there is only one DB? ...

Hibernate Mapped Superclass relationships and overriding

I have an abstract MappedSuperClass, Participant, which is extended by three kinds of 'Participant'. Each one then uses its own kind of 'Project', also an abstract MappedSuperClass. However, I want the base class to know about Projects so I can write generic code to interact with Participants. How do I specify this using Hibernate annota...

Error Hibernate BatchedTooManyRowsAffectedException sqlserver 2000

Hi try to create batch execution list of object to SqlServer through Hibernate DAO . my DAO code as follows: @Override public void save(List<Tagihan> listTagihan) { logger.debug("save list invoked"); Session session = sessionFactory.openSession(); try { session.beginTransaction(); int ...

Broken Hibernate Save Method

I have the following method in my Java application's DAO layer: public void save(Employee emp) { System.out.println("emp type: " + emp.getClass().getName); getHibernateTemplate().save(emp); System.out.println("object saved!"); System.out.flush(); } The employee class does not extend from any other classes and has t...

NHibernate MultiQuery for Java

NHibernate (for .Net) has an interface called IMultiQuery which you can instantiate an implementation for using ISession.CreateMultiQuery(). A multi-query allows one to run multiple hql statements in a single batch. I can't seem to find an equivalent feature in Hibernate (for Java). Multi-query would be perfect for the java application ...