Search...
FAQs
Subscribe
Pie
FAQs
Recent topics
Flagged topics
Hot topics
Best topics
Search...
Search within Struts
Search Coderanch
Advance search
Google search
Register / Login
Win a copy of
Cloud Application Architecture Patterns: Designing, Building, and Modernizing for the Cloud
this week in the
Cloud/Virtualization
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
Pie Elite
all forums
this forum made possible by our volunteer staff, including ...
Marshals:
Campbell Ritchie
Tim Cooke
paul wheaton
Paul Clapham
Ron McLeod
Sheriffs:
Jeanne Boyarsky
Liutauras Vilda
Saloon Keepers:
Tim Holloway
Carey Brown
Roland Mueller
Piet Souris
Bartenders:
Forum:
Struts
entity was not persistent in delete processing
Josep M Serrainat
Greenhorn
Posts: 16
posted 14 years ago
Number of slices to send:
Optional 'thank-you' note:
Send
Hi, I have two entities, user and contact. The relation is OneToMany with hibernate.
// in User entity @OneToMany (fetch = FetchType.LAZY, mappedBy="owner") public List<Contact> getContacts(){ return contacts; } // in Contact entity @ManyToOne(fetch = FetchType.LAZY) @JoinColumn(name = "user_id", nullable = false) public User getOwner() { return owner; }
When I delete a contact of user I get this trace:
09:21:22,975 DEBUG AnnotationTransactionAttributeSource:110 - Adding transactional method [deleteContact] with attribute [PROPAGATION_REQUIRED,ISOLATION_DEFAULT] 09:21:22,978 DEBUG TransactionSynchronizationManager:140 - Retrieved value [org.springframework.orm.jpa.EntityManagerHolder@428aaed5] for key [org.springframework.orm.jpa.LocalContainerEntityManagerFactoryBean@6909506a] bound to thread [http-8080-2] 09:21:22,982 DEBUG JpaTransactionManager:281 - Found thread-bound EntityManager [org.hibernate.ejb.EntityManagerImpl@384e57ba] for JPA transaction 09:21:22,984 DEBUG JpaTransactionManager:319 - Using transaction object [org.springframework.orm.jpa.JpaTransactionManager$JpaTransactionObject@582d6583] 09:21:22,987 DEBUG JpaTransactionManager:347 - Creating new transaction with name [com.innoments.service.ContactService.deleteContact]: PROPAGATION_REQUIRED,ISOLATION_DEFAULT 09:21:22,989 DEBUG JDBCTransaction:54 - begin 09:21:22,992 DEBUG ConnectionManager:421 - opening JDBC connection 09:21:22,996 DEBUG DriverManagerDataSource:163 - Creating new JDBC DriverManager Connection to [jdbc:mysql://127.0.0.1:3306/dbshoio] 09:21:23,040 DEBUG JDBCTransaction:59 - current autocommit status: true 09:21:23,050 DEBUG JDBCTransaction:62 - disabling autocommit 09:21:23,052 DEBUG JDBCContext:214 - after transaction begin 09:21:23,054 DEBUG JpaTransactionManager:344 - Exposing JPA transaction as JDBC transaction [SimpleConnectionHandle: com.mysql.jdbc.Connection@23ab8f3f] 09:21:23,055 DEBUG TransactionSynchronizationManager:168 - Bound value [org.springframework.jdbc.datasource.ConnectionHolder@54498364] for key [org.springframework.jdbc.datasource.DriverManagerDataSource@7fdb04ed] to thread [http-8080-2] 09:21:23,056 DEBUG TransactionSynchronizationManager:222 - Initializing transaction synchronization 09:21:23,057 DEBUG TransactionInterceptor:282 - Getting transaction for [com.innoments.service.ContactService.deleteContact] 09:21:23,058 DEBUG TransactionSynchronizationManager:140 - Retrieved value [org.springframework.orm.jpa.EntityManagerHolder@428aaed5] for key [org.springframework.orm.jpa.LocalContainerEntityManagerFactoryBean@6909506a] bound to thread [http-8080-2] 09:21:23,073 DEBUG DefaultDeleteEventListener:76 - entity was not persistent in delete processing 09:21:23,075 DEBUG ContactDaoImpl:53 - BaseJpaDao::remove(ID id) ->[9] 09:21:23,096 DEBUG TransactionInterceptor:312 - Completing transaction for [com.innoments.service.ContactService.deleteContact] 09:21:23,098 DEBUG JpaTransactionManager:833 - Triggering beforeCommit synchronization 09:21:23,099 DEBUG JpaTransactionManager:846 - Triggering beforeCompletion synchronization 09:21:23,100 DEBUG JpaTransactionManager:660 - Initiating transaction commit 09:21:23,107 DEBUG JpaTransactionManager:429 - Committing JPA transaction on EntityManager [org.hibernate.ejb.EntityManagerImpl@384e57ba] 09:21:23,109 DEBUG JDBCTransaction:103 - commit 09:21:23,110 DEBUG SessionImpl:338 - automatically flushing session 09:21:23,111 DEBUG AbstractFlushingEventListener:58 - flushing session 09:21:23,112 DEBUG AbstractFlushingEventListener:111 - processing flush-time cascades 09:21:23,113 DEBUG Cascade:116 - processing cascade ACTION_PERSIST_ON_FLUSH for: com.innoments.model.Contact 09:21:23,114 DEBUG Cascade:151 - done processing cascade ACTION_PERSIST_ON_FLUSH for: com.innoments.model.Contact 09:21:23,117 DEBUG AbstractFlushingEventListener:154 - dirty checking collections 09:21:23,121 DEBUG AbstractFlushingEventListener:171 - Flushing entities and processing referenced collections 09:21:23,123 DEBUG AbstractFlushingEventListener:210 - Processing unreferenced collections 09:21:23,126 DEBUG AbstractFlushingEventListener:224 - Scheduling collection removes/(re)creates/updates 09:21:23,127 DEBUG AbstractFlushingEventListener:85 - Flushed: 0 insertions, 0 updates, 0 deletions to 1 objects 09:21:23,131 DEBUG AbstractFlushingEventListener:91 - Flushed: 0 (re)creations, 0 updates, 0 removals to 0 collections 09:21:23,136 DEBUG Printer:83 - listing entities: 09:21:23,138 DEBUG Printer:90 - com.innoments.model.Contact{id=9, lastName=Puig Borras, profileType=OTHER, nickname=nurieta2, lastUpdate=2010-10-25 08:41:18, event=null, owner=com.innoments.model.User#2, longitude=null, latitude=null, firstName=NĂºria} 09:21:23,142 DEBUG AbstractFlushingEventListener:290 - executing flush 09:21:23,143 DEBUG ConnectionManager:469 - registering flush begin 09:21:23,144 DEBUG ConnectionManager:478 - registering flush end 09:21:23,146 DEBUG AbstractFlushingEventListener:321 - post flush 09:21:23,151 DEBUG JDBCContext:205 - before transaction completion 09:21:23,152 DEBUG SessionImpl:394 - before transaction completion 09:21:23,153 DEBUG JDBCTransaction:193 - re-enabling autocommit 09:21:23,163 DEBUG JDBCTransaction:116 - committed JDBC Connection 09:21:23,164 DEBUG JDBCContext:219 - after transaction completion 09:21:23,165 DEBUG ConnectionManager:404 - aggressively releasing JDBC connection 09:21:23,166 DEBUG ConnectionManager:441 - releasing JDBC connection [ (open PreparedStatements: 0, globally: 0) (open ResultSets: 0, globally: 0)] 09:21:23,167 DEBUG SessionImpl:423 - after transaction completion 09:21:23,168 DEBUG JpaTransactionManager:859 - Triggering afterCommit synchronization 09:21:23,169 DEBUG JpaTransactionManager:875 - Triggering afterCompletion synchronization 09:21:23,170 DEBUG TransactionSynchronizationManager:276 - Clearing transaction synchronization 09:21:23,172 DEBUG TransactionSynchronizationManager:193 - Removed value [org.springframework.jdbc.datasource.ConnectionHolder@54498364] for key [org.springframework.jdbc.datasource.DriverManagerDataSource@7fdb04ed] from thread [http-8080-2] 09:21:23,175 DEBUG JpaTransactionManager:517 - Not closing pre-bound JPA EntityManager after transaction 09:21:23,182 DEBUG DefaultListableBeanFactory:385 - No bean named 'org.apache.struts2.dispatcher.ServletActionRedirectResult' found in org.springframework.beans.factory.support.DefaultListableBeanFactory@6647108e: defining beans [_authenticationManager,_filterChainProxy,_httpSessionContextIntegrationFilter,_filterChainProxyPostProcessor,_filterChainList,_securityContextHolderAwareRequestFilter,_accessManager,_portMapper,_exceptionTranslationFilter,_filterSecurityInterceptor,_sessionRegistry,_concurrentSessionController,_concurrentSessionFilter,_sessionFixationProtectionFilter,_anonymousAuthenticationProvider,_anonymousProcessingFilter,_formLoginFilter,_formLoginEntryPoint,_defaultLoginPageFilter,_entryPointInjectionBeanPostProcessor,_userServiceInjectionPostProcessor,org.springframework.security.providers.dao.DaoAuthenticationProvider#0,org.springframework.security.userdetails.jdbc.JdbcUserDetailsManager#0,org.springframework.security.config.AuthenticationProviderBeanDefinitionParser$AuthenticationProviderCacheResolver#0,org.springframework.orm.jpa.support.PersistenceAnnotationBeanPostProcessor#0,entityManagerFactory,dataSource,transactionManager,org.springframework.aop.config.internalAutoProxyCreator,org.springframework.transaction.interceptor.TransactionAttributeSourceAdvisor#0,userDao,roleDao,contactDao,userService,contactService,registerAction,contactAction]; root of factory hierarchy
And Contact is not drop from database. What I'm doing wrong?
Consider Paul's
rocket mass heater
.
reply
reply
Bookmark Topic
Watch Topic
New Topic
Boost this thread!
Similar Threads
Hibernate: Found two representations of same collection
Hibernate StackOverflowError: bidirectional many-to-many
No error/exception in log on insert yet no row inserted to db
insert/update value of the FOREIGN KEY is not equal to any value of parent key of parent table:DB2
could not parse mapping resource.
More...