[JCA] - JGeometry.store and multiple connections
by xiao fong
xiao fong [http://community.jboss.org/people/runner1] created the discussion
"JGeometry.store and multiple connections"
To view the discussion, visit: http://community.jboss.org/message/568490#568490
--------------------------------------------------------------
Hi,
For some reason, I am getting the following error:
Caused by: java.sql.SQLException: Cannot construct ARRAY instance, invalid connection
at oracle.sql.ARRAY.<init>(ARRAY.java:141)
at oracle.spatial.geometry.JGeometry.store(JGeometry.java:1289)
at com.navteq.dc.hibernate.JGeometryType.nullSafeSet(JGeometryType.java:223)
at org.hibernate.type.CustomType.nullSafeSet(CustomType.java:146)
at org.hibernate.persister.entity.AbstractEntityPersister.dehydrate(AbstractEntityPersister.java:1992)
at org.hibernate.persister.entity.AbstractEntityPersister.update(AbstractEntityPersister.java:2366)
... 99 more
09:28:49,131 ERROR [ContainerBase] Servlet.service() for servlet diciWebTools threw exception
java.sql.SQLException: Cannot construct ARRAY instance, invalid connection
at oracle.sql.ARRAY.<init>(ARRAY.java:141)
at oracle.spatial.geometry.JGeometry.store(JGeometry.java:1289)
Caused by: java.sql.SQLException: Cannot construct ARRAY instance, invalid connection
at oracle.sql.ARRAY.<init>(ARRAY.java:141)
at oracle.spatial.geometry.JGeometry.store(JGeometry.java:1289)
at com.mycompany.dc.hibernate.JGeometryType.nullSafeSet(JGeometryType.java:223)
at org.hibernate.type.CustomType.nullSafeSet(CustomType.java:146)
at org.hibernate.persister.entity.AbstractEntityPersister.dehydrate(AbstractEntityPersister.java:1992)
at org.hibernate.persister.entity.AbstractEntityPersister.update(AbstractEntityPersister.java:2366)
... 99 more
I have found some blogs online. I am not sure if there are other solutions. Here is what they suggested.
public static void clearDBDescriptors()
{
geomDesc = null;
pointDesc = null;
elemInfoDesc = null;
ordinatesDesc = null;
}
Any advice please.
Thanks.
--------------------------------------------------------------
Reply to this message by going to Community
[http://community.jboss.org/message/568490#568490]
Start a new discussion in JCA at Community
[http://community.jboss.org/choose-container!input.jspa?contentType=1&cont...]
15 years, 6 months
[JBoss Tools] - How we use jface databinding in Deltacloud Tools
by Andre Dietisheim
Andre Dietisheim [http://community.jboss.org/people/adietish] modified the document:
"How we use jface databinding in Deltacloud Tools"
To view the document, visit: http://community.jboss.org/docs/DOC-15964
--------------------------------------------------------------
h1. Less code
If you use jface databinding to code your swt views in Eclipse you'll get spared from writing listeners and updating code by hand. JFace databinding offers very nice abstractions and automatisms that offer funcitonalities for the vast majority of the tasks where you have to listen for user input and update the view accordingly.
h1. *Premise*
If you implement a complex and highly dynamic UI in Eclipse you'll have to code many many many listener that wait for user actions. Those listeners mostly do nothing spectacular but update widgets and models in reaction to the user inputs. You end up with a lot of repetitive boilerplate code. UI frameworks in the non-java land (ex. http://qt.nokia.com/products/ Trolltechs QT) already have approaches that are far more elegant and slick than what we knew for Swing and SWT.
By luck Eclipse has progressed in this area (since 2005!) and offers neat abstractions that help a lot in this area and lead to far more concise and a less verbose implementations: Jface Databinding!
h2. Usecase
We had to implement a wizard page that allows a user to create a connection to a deltacloud server. The user has to supply a name, an url and the credentials for it.
http://community.jboss.org/servlet/JiveServlet/showImage/10530/cloud-conn... http://community.jboss.org/servlet/JiveServlet/downloadImage/10530/cloud-...
Sounds pretty simple at first sight. Looking closer at it you'll discover few buttons that shall be disabled if you enter inacurrate values. To inform the user in a intuitive way, the inaccurate values shall be marked by decorations. Furthermore a wizard page shows a global error message that reflects whether the user may finish the steps he's up to.
http://community.jboss.org/servlet/JiveServlet/showImage/10531/invalid-ur... http://community.jboss.org/servlet/JiveServlet/downloadImage/10531/invali...
h1. Solution
h2. No duplicate names
Our GUI holds multiple connections to various deltacloud servers. The wizard we discuss here allows you to edit existing connections or create new ones. You may of course not use a name that's already used for another connection. The wizard shall inform you that the name you chose is already used.
http://community.jboss.org/servlet/JiveServlet/showImage/10533/duplicate-... http://community.jboss.org/servlet/JiveServlet/downloadImage/10533/duplic...
To be intuitive the wizard shall decorate the field that's invalid. The wizard shall also show you what's wrong in cleartext and disallow you may to finish the wizard.
http://community.jboss.org/servlet/JiveServlet/showImage/102-15964-11-105... http://community.jboss.org/servlet/JiveServlet/downloadImage/102-15964-11...
You may have a look at the code we have in our svn to see the source code we discuss here: http://anonsvn.jboss.org/repos/jbosstools/trunk/deltacloud/plugins/org.jb... CloudConnectionPage.java
*Enable and disable Finish button*
http://community.jboss.org/servlet/JiveServlet/showImage/102-15964-11-105... http://community.jboss.org/servlet/JiveServlet/downloadImage/102-15964-11...
In non-technical pure logical terms there's a single trigger to all these markers: You entered a bad value to a field.
The wizard reacts by decorating the text field that holds a the duplicate name, it displays the error in the header and it disabled the Finish button.
Jface databinding offers a context that holds a global validity state for a form. If a form gets invalid, the golbal state gets invalid, too. A jface wizards is built upon several pages. Such a page is a form that may be globally valid or invalid.
> DataBindingContext dbc = new DataBindingContext();
To enable/disable the Finish button you now need to connect the wizard page to the DataBindingContext. Jface databinding will then enable/disable the Finish (or the Next Page button for instance) automatically for you. To bind the validity of the databinding context to the page validity, you only need 1 line of code:
> WizardPageSupport.create(this, dbc);
Jface databinding will now enable the finish button (or the next-page button) for you as soon as the form aka the databinding context is valid.
h2. Let's decorate the name text field
We have no settings that are tracked by jface databinding yet. Our databinding context's always valid for now. We will now add the name to our binding context, track its validity and propagate its state to the context.
h3. Observables
Jface databinding is a framework that is built upon the principle of *model-view-controller (MVC)*. It connects a view to a model and stips down the code that's needed to implement the controller.
It basically synchronizes the value that's in a view (a SWT widget in our case) to the value held in a model (a bean with a property name in our case). You may enter a new name in the widget and jface databinding makes sure that the model gets that new value. It of course does that the other way round, too: As soon as you set a new value to the model, jface databinding will set this value to the widget that's visible in the wizard.
In order to do that it must be aware of changes on both ends of this binding. It needs to be able to observe values and get notified of changes. Jface databinding implements its own observable pattern, it offers a standardized interface on both ends: *Observable*.
http://community.jboss.org/servlet/JiveServlet/showImage/102-15964-11-105... http://community.jboss.org/servlet/JiveServlet/downloadImage/102-15964-11...
SWT already offers Listeners that allow you to listen to changes in widgets and react to them. JFace databinding offers observable adapters that wrap these listeners and let them participate to the framework.
> IObservableValue textObservable = WidgetProperties.text(SWT.Modify).observe(nameText)
The jdk knows *PropertyChangeSupport* to observe changes in bean properties. Jface databinding also offers adapters to this observable pattern.
> IObservableValue beanPropertyObservable = BeanProperties.value(CloudConnectionModel.class, "name")
>
>
> IObservableValue beanPropertyObservable = BeanProperties.value(CloudConnectionModel.class, "name")
h1. Conclusione
--------------------------------------------------------------
Comment by going to Community
[http://community.jboss.org/docs/DOC-15964]
Create a new document in JBoss Tools at Community
[http://community.jboss.org/choose-container!input.jspa?contentType=102&co...]
15 years, 6 months
[Performance Tuning] - Duplicate request threads are received at JBoss during Load Testing only for some value of maxThreads
by Rupesh Bhadeshiya
Rupesh Bhadeshiya [http://community.jboss.org/people/rupesh.bhadeshiya] created the discussion
"Duplicate request threads are received at JBoss during Load Testing only for some value of maxThreads"
To view the discussion, visit: http://community.jboss.org/message/568481#568481
--------------------------------------------------------------
Hi.
(1) We are getting Duplicate http requests / threads in JBoss when carrying out Load Testing for below configuration/details:
Concurrent Load Test Requests Sent:
- 100 (i.e. 100 concurrent users/threads)
- Software Used is: Grinder tool
App Server: JBoss:
- version: 5.1.0.GA AS, Non clustered
- maxThreads: default (which is 200)
- Xmx = Xmx = 1024m (Total System RAM is 2GB)
- Database Connection Pool: Min=50, Max=100
Database: MySQL:
- version: 5.0.40 Enterprise Server (GPL)
Our Application Consists of:
- an ear comprising:
- a web application having an MVC framework (webwork)
- several EJB applications as needed by web application
Exception we are getting:
17:33:20,224 ERROR [JDBCExceptionReporter] Duplicate entry '1011287747835421-DEFAULT_USER' for key 2
17:33:20,249 ERROR [AbstractFlushingEventListener] Could not synchronize database state with session
org.hibernate.exception.ConstraintViolationException: Could not execute JDBC batch update
at org.hibernate.exception.SQLStateConverter.convert(SQLStateConverter.java:71)
at org.hibernate.exception.JDBCExceptionHelper.convert(JDBCExceptionHelper.java:43)
at org.hibernate.jdbc.AbstractBatcher.executeBatch(AbstractBatcher.java:249)
at org.hibernate.engine.ActionQueue.executeActions(ActionQueue.java:235)
at org.hibernate.engine.ActionQueue.executeActions(ActionQueue.java:139)
at org.hibernate.event.def.AbstractFlushingEventListener.performExecutions(AbstractFlushingEventListener.java:298)
at org.hibernate.event.def.DefaultFlushEventListener.onFlush(DefaultFlushEventListener.java:27)
at org.hibernate.impl.SessionImpl.flush(SessionImpl.java:1000)
at org.hibernate.impl.SessionImpl.managedFlush(SessionImpl.java:338)
at org.hibernate.transaction.CacheSynchronization.beforeCompletion(CacheSynchronization.java:59)
at com.arjuna.ats.internal.jta.resources.arjunacore.SynchronizationImple.beforeCompletion(SynchronizationImple.java:101)
at com.arjuna.ats.arjuna.coordinator.TwoPhaseCoordinator.beforeCompletion(TwoPhaseCoordinator.java:269)
at com.arjuna.ats.arjuna.coordinator.TwoPhaseCoordinator.end(TwoPhaseCoordinator.java:89)
at com.arjuna.ats.arjuna.AtomicAction.commit(AtomicAction.java:177)
at com.arjuna.ats.internal.jta.transaction.arjunacore.TransactionImple.commitAndDisassociate(TransactionImple.java:1423)
at com.arjuna.ats.internal.jta.transaction.arjunacore.BaseTransaction.commit(BaseTransaction.java:137)
at com.arjuna.ats.jbossatx.BaseTransactionManagerDelegate.commit(BaseTransactionManagerDelegate.java:75)
at org.jboss.tm.usertx.client.ServerVMClientUserTransaction.commit(ServerVMClientUserTransaction.java:162)
at org.springframework.transaction.jta.JtaTransactionManager.doCommit(JtaTransactionManager.java:1028)
at org.springframework.transaction.support.AbstractPlatformTransactionManager.processCommit(AbstractPlatformTransactionManager.java:732)
at org.springframework.transaction.support.AbstractPlatformTransactionManager.commit(AbstractPlatformTransactionManager.java:701)
at org.springframework.transaction.interceptor.TransactionAspectSupport.commitTransactionAfterReturning(TransactionAspectSupport.java:321)
at org.springframework.transaction.interceptor.TransactionInterceptor.invoke(TransactionInterceptor.java:116)
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:171)
at org.springframework.aop.framework.Cglib2AopProxy$DynamicAdvisedInterceptor.intercept(Cglib2AopProxy.java:635)
at com.csam.wsc.projects.jvl.wallet.lifecycle.WalletLifecycleServicesImpl$$EnhancerByCGLIB$$7dd95c8c.enrollWallet(<generated>)
at com.csam.wsc.projects.jvl.enabling.action.WalletActivationAction.enroll(WalletActivationAction.java:159)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at com.opensymphony.xwork.DefaultActionInvocation.invokeAction(DefaultActionInvocation.java:300)
at com.opensymphony.xwork.DefaultActionInvocation.invoke(DefaultActionInvocation.java:166)
at com.opensymphony.xwork.interceptor.AroundInterceptor.intercept(AroundInterceptor.java:35)
at com.opensymphony.xwork.DefaultActionInvocation.invoke(DefaultActionInvocation.java:164)
at com.csam.wsc.enabling.interceptor.UpgradeWalletInterceptor.intercept(UpgradeWalletInterceptor.java:100)
at com.opensymphony.xwork.DefaultActionInvocation.invoke(DefaultActionInvocation.java:164)
at com.csam.wsc.enabling.comms.interceptor.CommsBaseInterceptor.intercept(CommsBaseInterceptor.java:203)
at com.opensymphony.xwork.DefaultActionInvocation.invoke(DefaultActionInvocation.java:164)
at com.csam.wsc.services.messagebus.interceptor.CommsMessageBusProductionInterceptor.intercept(CommsMessageBusProductionInterceptor.java:38)
at com.opensymphony.xwork.DefaultActionInvocation.invoke(DefaultActionInvocation.java:164)
at com.opensymphony.xwork.DefaultActionProxy.execute(DefaultActionProxy.java:116)
at com.opensymphony.webwork.dispatcher.ServletDispatcher.serviceAction(ServletDispatcher.java:272)
at com.opensymphony.webwork.dispatcher.ServletDispatcher.service(ServletDispatcher.java:237)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
at org.jboss.web.tomcat.filters.ReplyHeaderFilter.doFilter(ReplyHeaderFilter.java:96)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:235)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191)
at org.jboss.web.tomcat.security.SecurityAssociationValve.invoke(SecurityAssociationValve.java:190)
at org.jboss.web.tomcat.security.JaccContextValve.invoke(JaccContextValve.java:92)
at org.jboss.web.tomcat.security.SecurityContextEstablishmentValve.process(SecurityContextEstablishmentValve.java:126)
at org.jboss.web.tomcat.security.SecurityContextEstablishmentValve.invoke(SecurityContextEstablishmentValve.java:70)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:127)
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)
at org.jboss.web.tomcat.service.jca.CachedConnectionValve.invoke(CachedConnectionValve.java:158)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:330)
at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:829)
at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:598)
at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:447)
at java.lang.Thread.run(Thread.java:662)
Caused by: java.sql.BatchUpdateException: Duplicate entry '1011287747835421-DEFAULT_USER' for key 2
at com.mysql.jdbc.PreparedStatement.executeBatchSerially(PreparedStatement.java:2007)
at com.mysql.jdbc.PreparedStatement.executeBatch(PreparedStatement.java:1443)
at org.jboss.resource.adapter.jdbc.WrappedStatement.executeBatch(WrappedStatement.java:774)
at org.hibernate.jdbc.BatchingBatcher.doExecuteBatch(BatchingBatcher.java:48)
at org.hibernate.jdbc.AbstractBatcher.executeBatch(AbstractBatcher.java:242)
... 62 more
We have found that we have a user record created in database on server side with the said id (1011287747835421). Hence it is clear that there was another thread trying to create user record with same id and hence failing. We also found that in this case, there is one request from Load Testing client that was not served by server. We matched both the requests we sent from Load Testing client and those for which server processed them and found that in each such (Duplicate entry exception) case, our web application could receive one request less than total request sent by Load Testing client.
(2) We also found that when we are incresing the maxThreads count to more value such as 500 or 700, we no more get the Duplicate request issue.
Can you please guide us what can be the issue?
Thanks in advance for any help on this matter.
Thanks & Best Regards,
Rupesh
--------------------------------------------------------------
Reply to this message by going to Community
[http://community.jboss.org/message/568481#568481]
Start a new discussion in Performance Tuning at Community
[http://community.jboss.org/choose-container!input.jspa?contentType=1&cont...]
15 years, 6 months