[JBoss Seam] - Re: Batch removing, conversations and transactions managment
by wschwendt
"v.masterov(a)gmail.com" wrote :
| I need to delete multiple entities at once, while some of them have references to other entities. When I try to delete a group of entities without any references, the operation is successful. But if at least one of the entities in the batch has references, the transaction is rolled back entirely.
|
Have you tried setting the cascade attribute in the annotations that define the relations between your entities? Eg.
| @OneToOne(cascade={CascadeType.REMOVE})
|
"v.masterov(a)gmail.com" wrote :
| I am trying to delete entities using separate transactions for each entity, but still fail.
|
First of all, I think you're confusing transactions with conversations here.
Secondly, why do you want to delete each entity within an own nested conversation?
I assume your intention probably is that if the remove operation for one entity fails, it shouldn't lead to failure of the remove operations for all the other entities.
Have you really investigated already whether an appropriate cascade remove setting for the relationships between your entities coulnd't solve your problem?
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4085050#4085050
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4085050
18 years, 10 months
[JBoss Seam] - Re: Seam PDF issue
by goku2
Yes, thats the normal thing to do but the deploy task in build.xml provided by seam setup doesn't add this jar.
For example
$ ant deploy
Creates a .war in the dist folder and copies the data source xml and this .war inside the deploy folder of your jboss as.
The thing is that the .war doesn't contains itext-2.0.x.jar in the lib folder.
You can solve this adding
inside the war task in your build.xml
Like this
| <copy todir="${war.dir}/WEB-INF/lib">
| <fileset dir="${lib.dir}">
| <include name="ajax4jsf*.jar" />
| <include name="richfaces*.jar" />
| <include name="oscache*.jar" />
| <include name="jsf-facelets.jar" />
| <include name="jboss-seam-*.jar" />
| <exclude name="jboss-seam-gen.jar" />
| <include name="drools-*.jar"/>
| <include name="janino-*.jar"/>
|
| <include name="itext-*.jar"/>
|
| <include name="antlr-*.jar"/>
| <include name="commons-jci-*.jar"/>
| <include name="stringtemplate-*.jar"/>
| </fileset>
| </copy>
|
|
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4085048#4085048
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4085048
18 years, 10 months
[EJB 3.0] - Problem with Native Queries
by rcherchi
Hi guys,
I'm trying to execute a simple native query using JBoss 4.0.5GA and EJB 3.0.
Here is my entity bean with the SqlResultSetMapping annotation:
@SqlResultSetMapping(name="poiResultsMapping",
| entities=(a)EntityResult(entityClass=POI.class,
| fields=@FieldResult(name="name", column="POI_NAME")))
| @Entity
| public class POI implements java.io.Serializable { ... }
Here is the native query which fails in the session bean.
| q = em.createNativeQuery("select p.POI_NAME from poi as p limit 8", "poiResultsMapping");
|
| this.poiResults = q.getResultList();
|
This is the cause of the error :
2007-09-17 13:36:53,608 INFO [org.hibernate.type.LongType] could not read column value from result set: POI2_12_0_;
Do you see what could be wrong with this code ? Did I forget something ?
Regards.
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4085040#4085040
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4085040
18 years, 10 months
[JBossCache] - Re: NullPointerException in PessimisticLockInterceptor
by manik.surtani@jboss.com
"jacek187" wrote :
| In my opinion TreeCache is yet NOT READY for production use. Probably it works in simple single-thread applications, but in real situations, with many concurent threads TreeCache dosen't work correctly...
|
No, more specifically, it IS ready for production use in multi threaded systems, but cleary does NOT behave well when used with a transaction manager that cleans up timed out transactions in a separate thread - specifically WebLogic's TM. This is evident in some of the JIRAs you have raised (such as JBCACHE-923).
The solution to this problem is unfortunately not that straightforward, since locks in JBC are obtained either on the Thread (in the case of non-tx operation) or a GlobalTransaction (in the case of running within a tx). Implicit in the design is that only one thread would ever use a GlobalTransaction object at a given time, and this is where it all breaks down when you have a TM that performs rollbacks in a separate thread. It opens up the possibility for the TM to be trying to obtain locks on a node to roll back, while your app thread tries to obtain locks on the same node to write to it. This WILL be allowed since they both pertain to the same GlobalTransaction object.
Jacek, I'd recommend joining the JBoss Cache dev mail list - we will be discussing this problem in more detail there.
Cheers,
Manik
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4085034#4085034
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4085034
18 years, 10 months