|
From: Thomas R. <tho...@tr...> - 2005-04-30 21:49:09
|
That's because the tutorial was created using an older version of HSQL.
The most recent version requires an explicit SHUTDOWN command to
release the lock.
You can modify the the "loadData" and task and add a COMMIT and
SHUTDOWN statement -- like this:
<target name="loadData">
<echo message="LOAD DATA USING: ${db.driver} ${db.url}"/>
<sql driver="${db.driver}"
url="${db.url}"
userid="${db.user}"
password="${db.pw}"
onerror="continue">
<classpath refid="master-classpath"/>
INSERT INTO products (id, description, price) values(1, 'Lamp',
5.78);
INSERT INTO products (id, description, price) values(2,
'Table', 75.29);
INSERT INTO products (id, description, price) values(3,
'Chair', 22.81);
COMMIT;
SHUTDOWN
</sql>
</target>
Thomas
On Apr 30, 2005, at 12:35 PM, V. Agarwal wrote:
> Tutorial:
> http://www.springframework.org/docs/MVC-step-by-step/Spring-MVC-step-
> by-step-Part-4.html
>
> ================
> ant junit (complains of locking !! - Any clues).
> ================
>
> C:\springapp>ant junit
> Buildfile: build.xml
>
> build:
>
> clearData:
> [echo] CLEAR DATA USING: org.hsqldb.jdbcDriver
> jdbc:hsqldb:db/test
> [sql] Executing commands
> [sql] 1 of 1 SQL statements executed
> successfully
>
> loadData:
> [echo] LOAD DATA USING: org.hsqldb.jdbcDriver
> jdbc:hsqldb:db/test
> [sql] Executing commands
> [sql] 3 of 3 SQL statements executed
> successfully
>
> [junit] Testcase:
> testIncreasePrice(tests.TestProductManagerDaoJdbc):
> Caused an ERROR
> [junit] Could not get JDBC connection; nested
> exception is java.sql.SQLExcep
> tion: The database is already in use by another
> process: org.hsqldb.NIOLockFile@
> e7d0d2d8[file =C:\springapp\db\test.lck, exists=true,
> locked=false, valid=false,
> fl =null]: java.lang.Exception: The process cannot
> access the file because anot
> her process has locked a portion of the file :
> C:\springapp\db\test.lck
> [junit]
> org.springframework.jdbc.CannotGetJdbcConnectionException:
> Could not
> get JDBC connection; nested exception is
> java.sql.SQLException: The database is
> already in use by another process:
> org.hsqldb.NIOLockFile@e7d0d2d8[file =C:\spr
> ingapp\db\test.lck, exists=true, locked=false,
> valid=false, fl =null]: java.lang
> .Exception: The process cannot access the file because
> another process has locke
> d a portion of the file : C:\springapp\db\test.lck
> [junit] java.sql.SQLException: The database is
> already in use by another pro
> cess: org.hsqldb.NIOLockFile@e7d0d2d8[file
> =C:\springapp\db\test.lck, exists=tru
> e, locked=false, valid=false, fl =null]:
> java.lang.Exception: The process cannot
> access the file because another process has locked a
> portion of the file : C:\s
> pringapp\db\test.lck
>
> [junit] Testcase:
> testGetProductList(tests.TestProductManagerDaoJdbc):
> Caused an ERROR
> [junit] Could not get JDBC connection; nested
> exception is java.sql.SQLExcep
> tion: The database is already in use by another
> process: org.hsqldb.NIOLockFile@
> e7d0d2d8[file =C:\springapp\db\test.lck, exists=true,
> locked=false, valid=false,
> fl =null]: java.lang.Exception: The process cannot
> access the file because anot
> her process has locked a portion of the file :
> C:\springapp\db\test.lck
> [junit]
> org.springframework.jdbc.CannotGetJdbcConnectionException:
> Could not
> get JDBC connection; nested exception is
> java.sql.SQLException: The database is
> already in use by another process:
> org.hsqldb.NIOLockFile@e7d0d2d8[file =C:\spr
> ingapp\db\test.lck, exists=true, locked=false,
> valid=false, fl =null]: java.lang
> .Exception: The process cannot access the file because
> another process has locke
> d a portion of the file : C:\springapp\db\test.lck
> [junit] java.sql.SQLException: The database is
> already in use by another pro
> cess: org.hsqldb.NIOLockFile@e7d0d2d8[file
> =C:\springapp\db\test.lck, exists=tru
> e, locked=false, valid=false, fl =null]:
> java.lang.Exception: The process cannot
> access the file because another process has locked a
> portion of the file : C:\s
> pringapp\db\test.lck
>
> BUILD FAILED
> ===============
> I seems to lock itself. Spring Framework supposed to
> connect and disconnect to Database automatically.
> It uses all the stuff in the tutorial.
> ==============
> Thanks.
>
>
>
> __________________________________
> Do you Yahoo!?
> Yahoo! Small Business - Try our new resources site!
> http://smallbusiness.yahoo.com/resources/
>
>
> -------------------------------------------------------
> This SF.Net email is sponsored by: NEC IT Guy Games.
> Get your fingers limbered up and give it your best shot. 4 great
> events, 4
> opportunities to win big! Highest score wins.NEC IT Guy Games. Play to
> win an NEC 61 plasma display. Visit http://www.necitguy.com/?r=20
> _______________________________________________
> Springframework-developer mailing list
> Spr...@li...
> https://lists.sourceforge.net/lists/listinfo/springframework-developer
>
>
|