org.springframework.transaction.CannotCreateTransactionException: Could not open JDBC Connection for transaction; nested exception is java.sql.SQLException: Connection was closed in SingleConnectionDataSource. Check that user code checks shouldClose() before closing Connections, or set 'suppressClose' to 'true'
at org.springframework.jdbc.datasource.DataSourceTransactionManager.doBegin(DataSourceTransactionManager.java:238)
at org.springframework.transaction.support.AbstractPlatformTransactionManager.getTransaction(AbstractPlatformTransactionManager.java:377)
at org.springframework.test.AbstractTransactionalSpringContextTests.startNewTransaction(AbstractTransactionalSpringContextTests.java:387)
at org.springframework.test.AbstractTransactionalSpringContextTests.onSetUp(AbstractTransactionalSpringContextTests.java:217)
at org.springframework.test.AbstractSingleSpringContextTests.setUp(AbstractSingleSpringContextTests.java:103)
at junit.framework.TestCase.runBare(TestCase.java:132)
at org.springframework.test.ConditionalTestCase.runBare(ConditionalTestCase.java:76)
at junit.framework.TestResult$1.protect(TestResult.java:110)
at junit.framework.TestResult.runProtected(TestResult.java:128)
at junit.framework.TestResult.run(TestResult.java:113)
at junit.framework.TestCase.run(TestCase.java:124)
at junit.framework.TestSuite.runTest(TestSuite.java:232)
at junit.framework.TestSuite.run(TestSuite.java:227)
at org.junit.internal.runners.JUnit38ClassRunner.run(JUnit38ClassRunner.java:83)
at org.eclipse.jdt.internal.junit4.runner.JUnit4TestReference.run(JUnit4TestReference.java:45)
at org.eclipse.jdt.internal.junit.runner.TestExecution.run(TestExecution.java:38)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:460)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:673)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:386)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:196)
Caused by: java.sql.SQLException: Connection was closed in SingleConnectionDataSource. Check that user code checks shouldClose() before closing Connections, or set 'suppressClose' to 'true'
at org.springframework.jdbc.datasource.SingleConnectionDataSource.getConnection(SingleConnectionDataSource.java:190)
at org.springframework.jdbc.datasource.lookup.AbstractRoutingDataSource.getConnection(AbstractRoutingDataSource.java:133)
at org.springframework.jdbc.datasource.DataSourceTransactionManager.doBegin(DataSourceTransactionManager.java:200)
While trying to perform unit tests on the various dao methods I had written for an Oracle database (8.1.7) using a SingleConnectionDatasource i came across this exception.
As a result I had to set suppressClose to true for the data source and manually close the transaction after each test case, using the tearDown method like following:
@Override
protected void onTearDown() throws Exception {
super.onTearDown();
Connection con = DataSourceUtils.getConnection(getJdbcTemplate().getDataSource());
DataSourceUtils.releaseConnection(con, getJdbcTemplate().getDataSource());
}
This helps to avoid the above problem
I guess this is a page to share all issues I have troubleshooted and found interesting enough to share. Also a place to give back something , in return of all the help I have received or taken from forums.
Wednesday, 17 March 2010
Monday, 3 August 2009
JavaFX Plugins available for Eclipse.
I started by installing the plugin created by Sun. Then I migrated to the plugin created by exadel.
Found the exadel plugin to be more friendly and less error prone .
However lack of context assist and code coloring in eclipse kind of turned me down.
Net beans is I guess the best IDE to work with javaFX as far as playing around and getting to know is concerned.
Found the exadel plugin to be more friendly and less error prone .
However lack of context assist and code coloring in eclipse kind of turned me down.
Net beans is I guess the best IDE to work with javaFX as far as playing around and getting to know is concerned.
Saturday, 1 August 2009
MySQL SQLyog
I have been actively using SQL Server 2005 for the past three four years. One of the things I like about it is its management studio , most of times I spend trying to design my queries , optimize them and add indexes accordingly.
Its graphical nature helps me work around SQL's in a better manner. I have not tried the express edition which is free .
I have recently come across this GUI management tool for the same called SQLyog. It provides all features similar to MS SQL Server management studio.
Convenient to make ER diagrams.
Powerful report generation.
Monitoring Support. etc
I will keep updating this post as and when I come across some more useful features.
Friday, 24 July 2009
StackOverflow
Nabble, ExpertExchange, Technology Forums and StackOverFlow.
All friends in time of need. Quality of questions and answers has been good so far on Stackoverflow.
One can login using Google as the open ID and easy p easy there on.
quest and anst journey begins
All friends in time of need. Quality of questions and answers has been good so far on Stackoverflow.
One can login using Google as the open ID and easy p easy there on.
quest and anst journey begins
Thursday, 23 July 2009
Free Mockup Designer - Pencil - FireFox
As a matter of interest I was trying to find out more about how to create digital mockups of software.
I have seen people using Visio, Adobe illustrator etc in the past. But in the world of open source there is a need of a good mockup designer.
Google my friend showed me some options.
ForeUI - Trial period - 7 days - not worth it , big download and no advantage
DesignerVista - Trial period - 20 days - save and print feature disabled - good for nothing
Balasmiq - Again we need to buy it aftera few days of trial, but good for its purpose i have read.
Fnally i chose Pencil , a plugin for firefox 3 onwards. Its allows the user to create mockups using windows widgets and some GTW widgets. We can also export the same to PNGs , which we can use in our high level designs and low level designs.
Served my purpose.
You can visitit at http://www.evolus.vn/Pencil/
I have seen people using Visio, Adobe illustrator etc in the past. But in the world of open source there is a need of a good mockup designer.
Google my friend showed me some options.
ForeUI - Trial period - 7 days - not worth it , big download and no advantage
DesignerVista - Trial period - 20 days - save and print feature disabled - good for nothing
Balasmiq - Again we need to buy it aftera few days of trial, but good for its purpose i have read.
Fnally i chose Pencil , a plugin for firefox 3 onwards. Its allows the user to create mockups using windows widgets and some GTW widgets. We can also export the same to PNGs , which we can use in our high level designs and low level designs.
Served my purpose.
You can visitit at http://www.evolus.vn/Pencil/
Free Project Hosting
Disclaimer : I am speaking ahead of myself , when I talk about this. But I have read and sound a few good options.
SourceForge: http://sourceforge.net/ - Open Source, Free
Google : http://code.google.com/projecthosting/ - Open Source
China University : https://opensvn.csie.org/ - Unlimited Storage , Free-Private
Project Locker: https://www.projectlocker.com - 500MB storage , free - 5 users-Private
These sites also provide free bug tracking , wiki, dashboard and integration and review facilities.
SourceForge: http://sourceforge.net/ - Open Source, Free
Google : http://code.google.com/projecthosting/ - Open Source
China University : https://opensvn.csie.org/ - Unlimited Storage , Free-Private
Project Locker: https://www.projectlocker.com - 500MB storage , free - 5 users-Private
These sites also provide free bug tracking , wiki, dashboard and integration and review facilities.
Wednesday, 22 July 2009
Google Analytics
Well once you have got a blog or a website setup , you would like to know more about the visitors so as to customise the website better for the audience.
I realised it really easy to do so using Google Analytics. All you need to have it a google id and then you can login using the same to google analytics .
Set up a profile for the website you want to track. Follow the instructions and copy the javascript snippet provided by them into the template for you website pages, such that each time you create a new page , the script is included in it.
This helps analytics track the visitors and their information and also helps you improve the content.
Its all easy when you are with google.
Traditionally , some website provide this by giving you website visitor counters which you can then display on the website , and then you can log into the tracking website to get more information about the visitors etc, However why maintain other accounts when you can manage it all with one id.
Google is winning and so am I.
I realised it really easy to do so using Google Analytics. All you need to have it a google id and then you can login using the same to google analytics .
Set up a profile for the website you want to track. Follow the instructions and copy the javascript snippet provided by them into the template for you website pages, such that each time you create a new page , the script is included in it.
This helps analytics track the visitors and their information and also helps you improve the content.
Its all easy when you are with google.
Traditionally , some website provide this by giving you website visitor counters which you can then display on the website , and then you can log into the tracking website to get more information about the visitors etc, However why maintain other accounts when you can manage it all with one id.
Google is winning and so am I.
Friday, 3 July 2009
Real VNC
Real Virtual Network Client.
I was looking for remote desktop clients apart from the standard windows desktop client.
I found this Real VNC Server and Client. All you need is to start the Real VNC Server on the machine you want to be accessible remotely. Configure the server with the user details and password details.
Install Real VNC Client on the machine you want to start the connection from.
It can be accessed via TCP IP over the internet as well.
However I cannnot get concurrent sessions working. It seems windows SP@ released a terminal services DLL which supposedly fixes this problem.
However its almost like hacking your system and you dont want to be playing with your system dlls.
I was looking for remote desktop clients apart from the standard windows desktop client.
I found this Real VNC Server and Client. All you need is to start the Real VNC Server on the machine you want to be accessible remotely. Configure the server with the user details and password details.
Install Real VNC Client on the machine you want to start the connection from.
It can be accessed via TCP IP over the internet as well.
However I cannnot get concurrent sessions working. It seems windows SP@ released a terminal services DLL which supposedly fixes this problem.
However its almost like hacking your system and you dont want to be playing with your system dlls.
Eclipse Europa is a hit and Galileo is out
I am a fan of the Eclipse IDE. Firstly because it suits my needs as a java developer and also because its free and yet has so much support via plugins , forums and help.
Eclipse Subversion Integration is really good, so good that I prefer that to the command line client and tortoise svn as well.
Eclipse JIRA integration is also good.
Some other plugins are PyDev for Python , Spring , JSF , XML, FOP, Hibernate, XSL Ant JUnit, TestNG, Wicket, Jetty.
Really good someone wanting to work with client server based applications.
Some of my friends have used IntelliJ , NetBeans, VisualStudio etc.
Please try the one which suits your options and reap the benifits.
Also good If you want to debug remote applications and local applications.
Eclipse Subversion Integration is really good, so good that I prefer that to the command line client and tortoise svn as well.
Eclipse JIRA integration is also good.
Some other plugins are PyDev for Python , Spring , JSF , XML, FOP, Hibernate, XSL Ant JUnit, TestNG, Wicket, Jetty.
Really good someone wanting to work with client server based applications.
Some of my friends have used IntelliJ , NetBeans, VisualStudio etc.
Please try the one which suits your options and reap the benifits.
Also good If you want to debug remote applications and local applications.
Office 2007 Vs 2003
Tried to avoid this as much as possible, but windows has its own way of making things interdependent. Yes I have installed MS Office on my laptop after almost one and a half year it being released. The only reason being I had got used to MS Office 2003 and and also wanted to retain Internet explorer 7 on my machine.
IE 8 is part of the package to get MS Office 2007 installed.
But I did like some features like as soon as you highlight a text Word gives out all options to format the text , cool , MS Excel also has got a lot of new menu changes as well as toolbar changes . Its an interesting journey and I have just started getting used to it. As very soon it will be part of industry standard.
Yet to explore the features of IE 8 , very difficult when you have firefox 3 and chrome to compare with.
Please watch this space for more MS office updates.
IE 8 is part of the package to get MS Office 2007 installed.
But I did like some features like as soon as you highlight a text Word gives out all options to format the text , cool , MS Excel also has got a lot of new menu changes as well as toolbar changes . Its an interesting journey and I have just started getting used to it. As very soon it will be part of industry standard.
Yet to explore the features of IE 8 , very difficult when you have firefox 3 and chrome to compare with.
Please watch this space for more MS office updates.
Subscribe to:
Comments (Atom)