[Persistence, JBoss/CMP, Hibernate, Database] - Manage data into a transaction
by warx
Hello everybdy,
i have a method in a Session EJB which creates a record ( using an Entity EJB CMP type).
After creating the record i call a Find method to check if there are some special data into a table and then i do something else.
The situaion is :
-- Method in the Session EJB
-- Create a record (TestEntity, Entity CMP) into the Table TEST
-- call Find method of the Entity EJB TestEntity to chec if the are
records inside the table TEST
-- do something
-- End of the Method in the Session EJB
Well, i noticed that, inside the transaction ( managed by the Session EJB) when i call the Find method the RECORD (inserted before in the Table TEST) exists.
So, if the table TEST is initially empty the Find method finds a Record; if the something goes wrong and the transaction fails, the table TEST get back empty.
Is it right, or this is only a JBoss beahaviour ?
Cheers.
Stefano
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4006240#4006240
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4006240
19 years, 3 months
[JBoss Messaging] - RMI class loader disabled
by Craig2007
Application Server - JBoss 4.0.4 GA
Messaging Server - Jboss-messaging-1.0.1.GA
I have deployed a simple web application under directory JBOSS_HOME/server/messaging/deploy.
I am trying to post some message from web application to JBoss Messaging Server.
when i perform the above said operation it gives me the following error in my server log .
1:41:42,649 INFO [PropertyMessageResources] Initializing, config='org.apache.struts.taglib.html.LocalStrings', returnNull=true
1:41:50,415 INFO [STDOUT] Inside the UserDAO password test
1:41:54,055 WARN [RequestProcessor] Unhandled Exception thrown: class javax.naming.CommunicationException
1:41:54,055 ERROR [[action]] Servlet.service() for servlet action threw exception
ava.lang.ClassNotFoundException: org.jboss.jms.destination.JBossQueue (no security manager: RMI class loader disabled)
at sun.rmi.server.LoaderHandler.loadClass(LoaderHandler.java:371)
at sun.rmi.server.LoaderHandler.loadClass(LoaderHandler.java:165)
at java.rmi.server.RMIClassLoader$2.loadClass(RMIClassLoader.java:620)
at org.jboss.system.JBossRMIClassLoader.loadClass(JBossRMIClassLoader.java:91)
at java.rmi.server.RMIClassLoader.loadClass(RMIClassLoader.java:247)
at sun.rmi.server.MarshalInputStream.resolveClass(MarshalInputStream.java:197)
at java.io.ObjectInputStream.readNonProxyDesc(ObjectInputStream.java:1538)
at java.io.ObjectInputStream.readClassDesc(ObjectInputStream.java:1460)
at java.io.ObjectInputStream.readOrdinaryObject(ObjectInputStream.java:1693)
at java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1299)
at java.io.ObjectInputStream.readObject(ObjectInputStream.java:339)
at java.rmi.MarshalledObject.get(MarshalledObject.java:135)
at org.jnp.interfaces.MarshalledValuePair.get(MarshalledValuePair.java:72)
at org.jnp.interfaces.NamingContext.lookup(NamingContext.java:652)
at org.jnp.interfaces.NamingContext.lookup(NamingContext.java:587)
at javax.naming.InitialContext.lookup(InitialContext.java:351)
at com.tcs.retail.framework.messaging.lookup.AdminObjectLookup.getQueueDestination(AdminObjectLookup.java:45)
at com.tcs.retail.framework.messaging.service.MessageTrackOnService.getMessageEntities(MessageTrackOnService.java:57)
at com.tcs.retail.messaging.struts.controller.action.ViewLinkAction.execute(Unknown Source)
at org.apache.struts.action.RequestProcessor.processActionPerform(RequestProcessor.java:484)
at org.apache.struts.action.RequestProcessor.process(RequestProcessor.java:274)
at org.apache.struts.action.ActionServlet.process(ActionServlet.java:1482)
at org.apache.struts.action.ActionServlet.doPost(ActionServlet.java:525)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:810)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:252)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
at org.jboss.web.tomcat.filters.ReplyHeaderFilter.doFilter(ReplyHeaderFilter.java:96)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:202)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:213)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:178)
at org.jboss.web.tomcat.security.SecurityAssociationValve.invoke(SecurityAssociationValve.java:175)
at org.jboss.web.tomcat.security.JaccContextValve.invoke(JaccContextValve.java:74)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:126)
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:105)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:107)
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:148)
at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:869)
at org.apache.coyote.http11.Http11BaseProtocol$Http11ConnectionHandler.processConnection(Http11BaseProtocol.java:664)
at org.apache.tomcat.util.net.PoolTcpEndpoint.processSocket(PoolTcpEndpoint.java:527)
at org.apache.tomcat.util.net.MasterSlaveWorkerThread.run(MasterSlaveWorkerThread.java:112)
at java.lang.Thread.run(Thread.java:595)
Please do shed some light on the above problem and also do tell me a way to overcome this problem.
My main objective is to post message from web application and also to retrieve a message from Queue or topic for viewing purpose only.
My web application is an ordinary web application with views and Service componenets.Service components interact with
messaging related components for sending and posting message.
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4006239#4006239
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4006239
19 years, 3 months
[Persistence, JBoss/CMP, Hibernate, Database] - declaring an index on a table
by andstall
I have a very big table of customers, with the primary key being the customer id.
One of the columns is zip, i.e. zip code of the customer location. How do I declare EJB 3.0 persistence annotations that there must be an index on that column?
A very frequent query is get customers by zip. That usually returns less than 10 customers (even no customers at all), sometimes up to 70 and very seldom more than that. I don't think the query should scan the whole table to find the customers in one zip code.
A possible solution would be to declare a zip entity and declare a one to many relationship between zips and customers. But this is probably overkill as I have no satellite data associated with the zip, for our app it is only a meaningless number we group customers by. Also this solution would imply yet another table (zip_customer).
Is indeed declaring an index on the zip column the best for me? How do I do it?
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4006233#4006233
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4006233
19 years, 3 months