[JBoss Cache: Core Edition] - Re: How I store objects in the cache. Trivial-not trivial?
by manik.surtani@jboss.com
"beep_beep" wrote : 1. Why I've chosen to create separate node for collection of A?
| 2. Why not separate node for each A in collection?
| 3. Why not separate node for each A and separate node for each A primitive attribute(int x)?
| 4. When I need cache B(that under A), what is my considerations: should I create separate node for each B, or one node for collection of Bs?
|
| 5.Is there some guide line to HOW we store complex structures in the cache?
| 6. If object A changed and I have eviction enabled in cluster, is it explicitly invalidates also Bs, that under that A? If B changed, does it cause invalidation of A? In what case it may happen?
|
1. I don't know; why have you? :-)
2. Could be done. If this is what you want.
3. This is what POJO Cache does.
4. Up to you, depending on your access patterns of B.
5. Not yet. But it is a good idea to start one on the wiki.
6. No, only a specific node is invalidated. If you are looking for invalidation of related objects, look at POJO Cache which will maintain object relationships.
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4153952#4153952
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4153952
17 years, 11 months
[Persistence, JBoss/CMP, Hibernate, Database] - Re: QuerySyntaxException Class is not mapped JBOSS 4.2.2GA E
by jaikiran
As i suspected, the logs show no indication that the "Account" entity is being mapped. For example, when i deploy my sample application with entities, i see this on the console:
8:18:47,998 INFO [JmxKernelAbstraction] jboss.jca:name=EJB3PersistenceDS,service=DataSourceBinding
| 8:18:47,998 INFO [PersistenceUnitDeployment] Starting persistence unit persistence.units:ear=EJB3Persistence.ear,jar=myapp_ejb3.jar,unitName=EJB3Persistence
| 8:18:48,060 INFO [Version] Hibernate EntityManager 3.2.1.GA
| 8:18:48,107 INFO [Version] Hibernate Annotations 3.2.1.GA
| 8:18:48,123 INFO [Environment] Hibernate 3.2.4.sp1
| 8:18:48,138 INFO [Environment] hibernate.properties not found
| 8:18:48,138 INFO [Environment] Bytecode provider name : javassist
| 8:18:48,138 INFO [Environment] using JDK 1.4 java.sql.Timestamp handling
| .....
|
| 8:18:48,857 INFO [AnnotationBinder] Binding entity from annotated class: org.myapp.entity.User
| 8:18:48,935 INFO [EntityBinder] Bind entity org.myapp.entity.User on table User
| 8:18:49,467 INFO [AnnotationBinder] Binding entity from annotated class: org.myapp.entity.Account
| 8:18:49,467 INFO [EntityBinder] Bind entity org.myapp.entity.Account on table Account
| 8:18:49,482 INFO [AnnotationBinder] Binding entity from annotated class: org.myapp.entity.TestIdClass
| 8:18:49,513 INFO [EntityBinder] Bind entity org.myapp.entity.TestIdClass on table EJB3Test
| 8:18:49,529 INFO [AnnotationBinder] Binding entity from annotated class: org.myapp.entity.DeleteMe
| 8:18:49,529 INFO [EntityBinder] Bind entity org.myapp.entity.DeleteMe on table DELETEME
| 8:18:49,560 INFO [CollectionBinder] Mapping collection: org.myapp.entity.User.accounts -> Account
| 8:18:50,185 INFO [ConnectionProviderFactory] Initializing connection provider: org.hibernate.ejb.connection.InjectedDataSourceConnectionProvider
| 8:18:50,201 INFO [InjectedDataSourceConnectionProvider] Using provided datasource
| 8:18:50,654 INFO [SettingsFactory] RDBMS: MySQL, version: 5.0.20-community
It looks like a packaging problem.
anonymous wrote : The Account.class is part of the DAO and is in datamodel.jar while the other classes are in another services.jar file. I have packaged the persistence.xml in the META-INF of both jar.
|
Usually, the persistence.xml file should be present in only the jar which contains the entity classes. Try removing the persistence.xml file from the services.jar file (which i assume does not have any entities).
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4153936#4153936
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4153936
17 years, 11 months