HSQLDB locking when using tomcat plugin

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
17 messages Options
Reply | Threaded
Open this post in threaded view
|

HSQLDB locking when using tomcat plugin

Sebastien ARBOGAST
Hi,

I'm using Codeczar tomcat plugin to manipulate my tomcat server for my
web application.
So when I have to recompile some Java class while my Tomcat server is
running I want to execute the following procedure :

maven tomcat:stop
maven war:webapp
maven tomcat:start

But then when I try to access my database (HSQLDB in file protocol,
In-process mode) through my application, I get the following error
message :

The database is already in use by another process:
org.hsqldb.NIOLockFile@98c4b002[file
=C:\dev\pfe\schaman\target\webapp\WEB-INF\db\schamandb.lck,
exists=true, locked=false, valid=false, fl =null]:

The problem seems to be that when the application is stopped, the lock
on schamandb.lck is not released. Does anyone know how to solve this
situation or do I have to stop the server everytime I have something
to recompile ?

My configuration is the following :
- HSQLDB 1.7.3.3
- Maven 1.0.2
- maven-tomcat-plugin version 1.1

Thx in advance.

--
Sebastien ARBOGAST

---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|

Re: HSQLDB locking when using tomcat plugin

Siegfried Goeschl
Hi Sebastien,

I think you need to issue a SQL shutdown command for HSQLDB which also
compacts the database

Cheers,

Siegfried Goeschl

Sebastien Arbogast wrote:

>Hi,
>
>I'm using Codeczar tomcat plugin to manipulate my tomcat server for my
>web application.
>So when I have to recompile some Java class while my Tomcat server is
>running I want to execute the following procedure :
>
>maven tomcat:stop
>maven war:webapp
>maven tomcat:start
>
>But then when I try to access my database (HSQLDB in file protocol,
>In-process mode) through my application, I get the following error
>message :
>
>The database is already in use by another process:
>org.hsqldb.NIOLockFile@98c4b002[file
>=C:\dev\pfe\schaman\target\webapp\WEB-INF\db\schamandb.lck,
>exists=true, locked=false, valid=false, fl =null]:
>
>The problem seems to be that when the application is stopped, the lock
>on schamandb.lck is not released. Does anyone know how to solve this
>situation or do I have to stop the server everytime I have something
>to recompile ?
>
>My configuration is the following :
>- HSQLDB 1.7.3.3
>- Maven 1.0.2
>- maven-tomcat-plugin version 1.1
>
>Thx in advance.
>
>  
>


---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|

Re: HSQLDB locking when using tomcat plugin

Phillip Rhodes-2
In reply to this post by Sebastien ARBOGAST
I am not aware of the ability to issue a sql shutdown
to an in-process HSQL instance.

In your case, it would appear to me that you will have
to stop the server.

HTH


--- Siegfried Goeschl <[hidden email]>
wrote:

> Hi Sebastien,
>
> I think you need to issue a SQL shutdown command for
> HSQLDB which also
> compacts the database
>
> Cheers,
>
> Siegfried Goeschl
>
> Sebastien Arbogast wrote:
>
> >Hi,
> >
> >I'm using Codeczar tomcat plugin to manipulate my
> tomcat server for my
> >web application.
> >So when I have to recompile some Java class while
> my Tomcat server is
> >running I want to execute the following procedure :
> >
> >maven tomcat:stop
> >maven war:webapp
> >maven tomcat:start
> >
> >But then when I try to access my database (HSQLDB
> in file protocol,
> >In-process mode) through my application, I get the
> following error
> >message :
> >
> >The database is already in use by another process:
> >org.hsqldb.NIOLockFile@98c4b002[file
>
>=C:\dev\pfe\schaman\target\webapp\WEB-INF\db\schamandb.lck,
> >exists=true, locked=false, valid=false, fl =null]:
> >
> >The problem seems to be that when the application
> is stopped, the lock
> >on schamandb.lck is not released. Does anyone know
> how to solve this
> >situation or do I have to stop the server everytime
> I have something
> >to recompile ?
> >
> >My configuration is the following :
> >- HSQLDB 1.7.3.3
> >- Maven 1.0.2
> >- maven-tomcat-plugin version 1.1
> >
> >Thx in advance.
> >
> >  
> >
>
>
>
---------------------------------------------------------------------
> To unsubscribe, e-mail:
> [hidden email]
> For additional commands, e-mail:
> [hidden email]
>
>

---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|

Re: HSQLDB locking when using tomcat plugin

Dan Tran
When the appserver stop your app, i am sure it will give your webapp a
chance to
cleanup, by that time, you must issue sql "SHUTDOWN".  

-Dan



On 5/25/05, phillip rhodes <[hidden email]> wrote:

> I am not aware of the ability to issue a sql shutdown
> to an in-process HSQL instance.
>
> In your case, it would appear to me that you will have
> to stop the server.
>
> HTH
>
>
> --- Siegfried Goeschl <[hidden email]>
> wrote:
> > Hi Sebastien,
> >
> > I think you need to issue a SQL shutdown command for
> > HSQLDB which also
> > compacts the database
> >
> > Cheers,
> >
> > Siegfried Goeschl
> >
> > Sebastien Arbogast wrote:
> >
> > >Hi,
> > >
> > >I'm using Codeczar tomcat plugin to manipulate my
> > tomcat server for my
> > >web application.
> > >So when I have to recompile some Java class while
> > my Tomcat server is
> > >running I want to execute the following procedure :
> > >
> > >maven tomcat:stop
> > >maven war:webapp
> > >maven tomcat:start
> > >
> > >But then when I try to access my database (HSQLDB
> > in file protocol,
> > >In-process mode) through my application, I get the
> > following error
> > >message :
> > >
> > >The database is already in use by another process:
> > >org.hsqldb.NIOLockFile@98c4b002[file
> >
> >=C:\dev\pfe\schaman\target\webapp\WEB-INF\db\schamandb.lck,
> > >exists=true, locked=false, valid=false, fl =null]:
> > >
> > >The problem seems to be that when the application
> > is stopped, the lock
> > >on schamandb.lck is not released. Does anyone know
> > how to solve this
> > >situation or do I have to stop the server everytime
> > I have something
> > >to recompile ?
> > >
> > >My configuration is the following :
> > >- HSQLDB 1.7.3.3
> > >- Maven 1.0.2
> > >- maven-tomcat-plugin version 1.1
> > >
> > >Thx in advance.
> > >
> > >
> > >
> >
> >
> >
> ---------------------------------------------------------------------
> > To unsubscribe, e-mail:
> > [hidden email]
> > For additional commands, e-mail:
> > [hidden email]
> >
> >
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [hidden email]
> For additional commands, e-mail: [hidden email]
>
>

---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|

Re: HSQLDB locking when using tomcat plugin

Sebastien ARBOGAST
2005/5/25, dan tran <[hidden email]>:
> When the appserver stop your app, i am sure it will give your webapp a
> chance to
> cleanup, by that time, you must issue sql "SHUTDOWN".

Yes that's also what I found out thanks to HSQLDB forums... so now I
have to find a way to issue that damn SQL SHUTDOWN with a proper
configuration of my Spring datasource bean... or just before the
application is shutdown. It's not easy because there are so many
technologies involved that I don't even know where to ask that
question :-P

--
Sebastien ARBOGAST

---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|

Re: HSQLDB locking when using tomcat plugin

Kenney Westerhof
On Wed, 25 May 2005, Sebastien Arbogast wrote:

> 2005/5/25, dan tran <[hidden email]>:

Can't you just set reload="true" in your context.xml? That way when the
new war (or exploded war) is deployed, tomcat will reload the webapp
and there's no need to stop/start tomcat. Use only in dev-mode!

Where did you configure hsqldb to run? in server.xml or in the webapp?
If you configure it in server.xml there should be no locking problems..

-- Kenney

> > When the appserver stop your app, i am sure it will give your webapp a
> > chance to
> > cleanup, by that time, you must issue sql "SHUTDOWN".
>
> Yes that's also what I found out thanks to HSQLDB forums... so now I
> have to find a way to issue that damn SQL SHUTDOWN with a proper
> configuration of my Spring datasource bean... or just before the
> application is shutdown. It's not easy because there are so many
> technologies involved that I don't even know where to ask that
> question :-P
>
> --
> Sebastien ARBOGAST
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [hidden email]
> For additional commands, e-mail: [hidden email]
>
>

--
Kenney Westerhof
http://www.neonics.com
GPG public key: http://www.gods.nl/~forge/kenneyw.key

---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|

Re: HSQLDB locking when using tomcat plugin

Siegfried Goeschl
In reply to this post by Phillip Rhodes-2
Hi Phillip,

from http://hsqldb.sourceforge.net/doc/guide/ch01.html#N10190

" All databases running in different modes can be closed with the
SHUTDOWN command, issued as an SQL query. In 1.7.2, in-process databases
are no longer closed when the last connection to the database is
explicitly closed via JDBC, a SHUTDOWN is required. When SHUTDOWN is
issued, all active transactions are rolled back. A special form of
closing the database is via the SHUTDOWN COMPACT command. This command
rewrites the .data file that contains the information stored in CACHED
tables and compacts it to size. This command should be issued
periodically, especially when lots of inserts, updates or deletes are
performed on the cached tables. Changes to the structure of the
database, such as dropping or modifying tables or indexes also create
large amounts of unused space that can be reclaimed using this command."

Having said that I'm not the HSQLDB expert - invoking stop() might solve
the problem but I prefer the SHUTDOWN since it compacts the database on
the fly.


Cheers,

Siegfried Goeschl

phillip rhodes wrote:

>I am not aware of the ability to issue a sql shutdown
>to an in-process HSQL instance.
>
>In your case, it would appear to me that you will have
>to stop the server.
>
>HTH
>
>
>--- Siegfried Goeschl <[hidden email]>
>wrote:
>  
>
>>Hi Sebastien,
>>
>>I think you need to issue a SQL shutdown command for
>>HSQLDB which also
>>compacts the database
>>
>>Cheers,
>>
>>Siegfried Goeschl
>>
>>Sebastien Arbogast wrote:
>>
>>    
>>
>>>Hi,
>>>
>>>I'm using Codeczar tomcat plugin to manipulate my
>>>      
>>>
>>tomcat server for my
>>    
>>
>>>web application.
>>>So when I have to recompile some Java class while
>>>      
>>>
>>my Tomcat server is
>>    
>>
>>>running I want to execute the following procedure :
>>>
>>>maven tomcat:stop
>>>maven war:webapp
>>>maven tomcat:start
>>>
>>>But then when I try to access my database (HSQLDB
>>>      
>>>
>>in file protocol,
>>    
>>
>>>In-process mode) through my application, I get the
>>>      
>>>
>>following error
>>    
>>
>>>message :
>>>
>>>The database is already in use by another process:
>>>org.hsqldb.NIOLockFile@98c4b002[file
>>>      
>>>
>>=C:\dev\pfe\schaman\target\webapp\WEB-INF\db\schamandb.lck,
>>    
>>
>>>exists=true, locked=false, valid=false, fl =null]:
>>>
>>>The problem seems to be that when the application
>>>      
>>>
>>is stopped, the lock
>>    
>>
>>>on schamandb.lck is not released. Does anyone know
>>>      
>>>
>>how to solve this
>>    
>>
>>>situation or do I have to stop the server everytime
>>>      
>>>
>>I have something
>>    
>>
>>>to recompile ?
>>>
>>>My configuration is the following :
>>>- HSQLDB 1.7.3.3
>>>- Maven 1.0.2
>>>- maven-tomcat-plugin version 1.1
>>>
>>>Thx in advance.
>>>
>>>
>>>
>>>      
>>>
>>
>>    
>>
>---------------------------------------------------------------------
>  
>
>>To unsubscribe, e-mail:
>>[hidden email]
>>For additional commands, e-mail:
>>[hidden email]
>>
>>
>>    
>>
>
>  
>

Reply | Threaded
Open this post in threaded view
|

Re: HSQLDB locking when using tomcat plugin

Sebastien ARBOGAST
> from http://hsqldb.sourceforge.net/doc/guide/ch01.html#N10190
>
> " All databases running in different modes can be closed with the
> SHUTDOWN command, issued as an SQL query. In 1.7.2, in-process databases
> are no longer closed when the last connection to the database is
> explicitly closed via JDBC, a SHUTDOWN is required. When SHUTDOWN is
> issued, all active transactions are rolled back. A special form of
> closing the database is via the SHUTDOWN COMPACT command. This command
> rewrites the .data file that contains the information stored in CACHED
> tables and compacts it to size. This command should be issued
> periodically, especially when lots of inserts, updates or deletes are
> performed on the cached tables. Changes to the structure of the
> database, such as dropping or modifying tables or indexes also create
> large amounts of unused space that can be reclaimed using this command."
>
> Having said that I'm not the HSQLDB expert - invoking stop() might solve
> the problem but I prefer the SHUTDOWN since it compacts the database on
> the fly.

I agree with you... the cleaner way to do things is to issue that damn
SQL SHUTDOWN but I don't know where I can configure something to issue
it automatically when my application is stopped. Does anyone know
where I can do this ?

> Can't you just set reload="true" in your context.xml? That way when the
> new war (or exploded war) is deployed, tomcat will reload the webapp
> and there's no need to stop/start tomcat. Use only in dev-mode!

Oh yes it would be great. Anyway my application won't leave dev-mode
before a long time ;-). So I customized my context file to look like
this

<?xml version='1.0' encoding='utf-8'?>
<Context docBase="C:/dev/myapp/target/webapp" path="/myapp" reload="true">
</Context>

But then the problem is that when I recompile a few files, it happens
that as soon as the first file is being modified, a reload is
initiated while the other files haven't been recompiled yet, which
causes numerous exceptions since it breaks the integrity of my
application.

> Where did you configure hsqldb to run? in server.xml or in the webapp?
> If you configure it in server.xml there should be no locking problems..

HSQLDB is configured to run inside my webapp in In-process mode. So
it's configured thanks to this Spring bean configuration :

<bean id="dataSource" class="org.apache.commons.dbcp.BasicDataSource"
destroy-method="close">
        <property
name="driverClassName"><value>org.hsqldb.jdbcDriver</value></property>
        <property name="username"><value>sa</value></property>
        <property
name="url"><value>jdbc:hsqldb:file:C:\dev\myapp/target/webapp/WEB-INF/db/myappdb</value></property>
    </bean>

So the file protocol allows me to avoid configuring any database
server. The database is a file accessed directly from within the main
application process. I know that this is not optimal in terms of
performance but I really don't care as my objective for now is to make
the deployment process as simple as possible since I'm still in dev
mode.

I think I really have to find a way to initiate a SHUTDOWN.

--
Sebastien ARBOGAST

---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|

Re: HSQLDB locking when using tomcat plugin

Dan Tran
You need to talk to Spring folk ;-)

-D

On 5/26/05, Sebastien Arbogast <[hidden email]> wrote:

> > from http://hsqldb.sourceforge.net/doc/guide/ch01.html#N10190
> >
> > " All databases running in different modes can be closed with the
> > SHUTDOWN command, issued as an SQL query. In 1.7.2, in-process databases
> > are no longer closed when the last connection to the database is
> > explicitly closed via JDBC, a SHUTDOWN is required. When SHUTDOWN is
> > issued, all active transactions are rolled back. A special form of
> > closing the database is via the SHUTDOWN COMPACT command. This command
> > rewrites the .data file that contains the information stored in CACHED
> > tables and compacts it to size. This command should be issued
> > periodically, especially when lots of inserts, updates or deletes are
> > performed on the cached tables. Changes to the structure of the
> > database, such as dropping or modifying tables or indexes also create
> > large amounts of unused space that can be reclaimed using this command."
> >
> > Having said that I'm not the HSQLDB expert - invoking stop() might solve
> > the problem but I prefer the SHUTDOWN since it compacts the database on
> > the fly.
>
> I agree with you... the cleaner way to do things is to issue that damn
> SQL SHUTDOWN but I don't know where I can configure something to issue
> it automatically when my application is stopped. Does anyone know
> where I can do this ?
>
> > Can't you just set reload="true" in your context.xml? That way when the
> > new war (or exploded war) is deployed, tomcat will reload the webapp
> > and there's no need to stop/start tomcat. Use only in dev-mode!
>
> Oh yes it would be great. Anyway my application won't leave dev-mode
> before a long time ;-). So I customized my context file to look like
> this
>
> <?xml version='1.0' encoding='utf-8'?>
> <Context docBase="C:/dev/myapp/target/webapp" path="/myapp" reload="true">
> </Context>
>
> But then the problem is that when I recompile a few files, it happens
> that as soon as the first file is being modified, a reload is
> initiated while the other files haven't been recompiled yet, which
> causes numerous exceptions since it breaks the integrity of my
> application.
>
> > Where did you configure hsqldb to run? in server.xml or in the webapp?
> > If you configure it in server.xml there should be no locking problems..
>
> HSQLDB is configured to run inside my webapp in In-process mode. So
> it's configured thanks to this Spring bean configuration :
>
> <bean id="dataSource" class="org.apache.commons.dbcp.BasicDataSource"
> destroy-method="close">
>        <property
> name="driverClassName"><value>org.hsqldb.jdbcDriver</value></property>
>        <property name="username"><value>sa</value></property>
>        <property
> name="url"><value>jdbc:hsqldb:file:C:\dev\myapp/target/webapp/WEB-INF/db/myappdb</value></property>
>    </bean>
>
> So the file protocol allows me to avoid configuring any database
> server. The database is a file accessed directly from within the main
> application process. I know that this is not optimal in terms of
> performance but I really don't care as my objective for now is to make
> the deployment process as simple as possible since I'm still in dev
> mode.
>
> I think I really have to find a way to initiate a SHUTDOWN.
>
> --
> Sebastien ARBOGAST
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [hidden email]
> For additional commands, e-mail: [hidden email]
>
>

---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|

Re: HSQLDB locking when using tomcat plugin

Siegfried Goeschl
In reply to this post by Sebastien ARBOGAST
Hi Sebastien,

I'm also not a Spring expert - actually I never used it - but

+) you might be able to derive from
org.apache.commons.dbcp.BasicDataSource and overwrite the close() method
+) add a custom HSQLDB shutdown bean for Spring
+) or write a little servlet which does the magic

Cheers,

Siegfried Goeschl

Sebastien Arbogast wrote:

>>from http://hsqldb.sourceforge.net/doc/guide/ch01.html#N10190
>>
>>" All databases running in different modes can be closed with the
>>SHUTDOWN command, issued as an SQL query. In 1.7.2, in-process databases
>>are no longer closed when the last connection to the database is
>>explicitly closed via JDBC, a SHUTDOWN is required. When SHUTDOWN is
>>issued, all active transactions are rolled back. A special form of
>>closing the database is via the SHUTDOWN COMPACT command. This command
>>rewrites the .data file that contains the information stored in CACHED
>>tables and compacts it to size. This command should be issued
>>periodically, especially when lots of inserts, updates or deletes are
>>performed on the cached tables. Changes to the structure of the
>>database, such as dropping or modifying tables or indexes also create
>>large amounts of unused space that can be reclaimed using this command."
>>
>>Having said that I'm not the HSQLDB expert - invoking stop() might solve
>>the problem but I prefer the SHUTDOWN since it compacts the database on
>>the fly.
>>    
>>
>
>I agree with you... the cleaner way to do things is to issue that damn
>SQL SHUTDOWN but I don't know where I can configure something to issue
>it automatically when my application is stopped. Does anyone know
>where I can do this ?
>
>  
>
>>Can't you just set reload="true" in your context.xml? That way when the
>>new war (or exploded war) is deployed, tomcat will reload the webapp
>>and there's no need to stop/start tomcat. Use only in dev-mode!
>>    
>>
>
>Oh yes it would be great. Anyway my application won't leave dev-mode
>before a long time ;-). So I customized my context file to look like
>this
>
><?xml version='1.0' encoding='utf-8'?>
><Context docBase="C:/dev/myapp/target/webapp" path="/myapp" reload="true">
></Context>
>
>But then the problem is that when I recompile a few files, it happens
>that as soon as the first file is being modified, a reload is
>initiated while the other files haven't been recompiled yet, which
>causes numerous exceptions since it breaks the integrity of my
>application.
>
>  
>
>>Where did you configure hsqldb to run? in server.xml or in the webapp?
>>If you configure it in server.xml there should be no locking problems..
>>    
>>
>
>HSQLDB is configured to run inside my webapp in In-process mode. So
>it's configured thanks to this Spring bean configuration :
>
><bean id="dataSource" class="org.apache.commons.dbcp.BasicDataSource"
>destroy-method="close">
>        <property
>name="driverClassName"><value>org.hsqldb.jdbcDriver</value></property>
>        <property name="username"><value>sa</value></property>
>        <property
>name="url"><value>jdbc:hsqldb:file:C:\dev\myapp/target/webapp/WEB-INF/db/myappdb</value></property>
>    </bean>
>
>So the file protocol allows me to avoid configuring any database
>server. The database is a file accessed directly from within the main
>application process. I know that this is not optimal in terms of
>performance but I really don't care as my objective for now is to make
>the deployment process as simple as possible since I'm still in dev
>mode.
>
>I think I really have to find a way to initiate a SHUTDOWN.
>
>  
>

Reply | Threaded
Open this post in threaded view
|

Re: HSQLDB locking when using tomcat plugin

Sebastien ARBOGAST
2005/5/26, Siegfried Goeschl <[hidden email]>:
>  I'm also not a Spring expert - actually I never used it - but
>  
>  +) you might be able to derive from
> org.apache.commons.dbcp.BasicDataSource and overwrite the
> close() method

I like this one but I can't figure out how I can access my database
from there to send the SQL instruction (I'm not an expert with dbcp at
all).

>  +) add a custom HSQLDB shutdown bean for Spring
>  +) or write a little servlet which does the magic

Why not but haven't a clue about how to do that.

> Would it be a good approach to use an AOP approach :
> - you create an aspect that will add behaviour to the close() method of
> your dataSource bean.

Technically that would be the most elegant solution even if I've never
used AOP. But there is another problem here : all my Spring files are
automatically generated through a MDA process (AndroMDA) and I'm quite
sure I can't integrate AOP in the process.

I think the most pragmatic solution right now would be to customize
the close method of my BasicDataSource. But the question is : can I
access my JDBC connection from there to issue my SHUTDOWN ?

(Why did they introduce that SHUTDOWN thing anyway ?!!! grrrrrr...)

--
Sebastien ARBOGAST

---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|

Re: HSQLDB locking when using tomcat plugin

Chad Brandon
Sebastien Arbogast wrote:

>2005/5/26, Siegfried Goeschl <[hidden email]>:
>  
>
>> I'm also not a Spring expert - actually I never used it - but
>>
>> +) you might be able to derive from
>>org.apache.commons.dbcp.BasicDataSource and overwrite the
>>close() method
>>    
>>
>
>I like this one but I can't figure out how I can access my database
>from there to send the SQL instruction (I'm not an expert with dbcp at
>all).
>
>  
>
>> +) add a custom HSQLDB shutdown bean for Spring
>> +) or write a little servlet which does the magic
>>    
>>
>
>Why not but haven't a clue about how to do that.
>
>  
>
>>Would it be a good approach to use an AOP approach :
>>- you create an aspect that will add behaviour to the close() method of
>>your dataSource bean.
>>    
>>
>
>Technically that would be the most elegant solution even if I've never
>used AOP. But there is another problem here : all my Spring files are
>automatically generated through a MDA process (AndroMDA) and I'm quite
>sure I can't integrate AOP in the process.
>  
>
You can easily use AOP with MDA, I use aspectj with my AndroMDA apps all
the time, because your system is generated does not mean you can't
introduce aspects into the process.

>I think the most pragmatic solution right now would be to customize
>the close method of my BasicDataSource. But the question is : can I
>access my JDBC connection from there to issue my SHUTDOWN ?
>
>(Why did they introduce that SHUTDOWN thing anyway ?!!! grrrrrr...)
>
>  
>


---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|

Re: HSQLDB locking when using tomcat plugin

Sebastien ARBOGAST
In reply to this post by Sebastien ARBOGAST
Actually I found out how to access my JDBC connection and I wrote  the
corresponding code but it appeared to be useless because my close()
method was simply not called at all.
So I'll give up with that as I have many other more important things
to achieve on that project. For now I'll just restart the whole server
every time and that's it...

Anyway I sincerely thank you all for your help, despite the fact that
this thread was not directly linked with maven.

Bye

--
Sebastien ARBOGAST

---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|

Re: HSQLDB locking when using tomcat plugin

Carlos Sanchez-2
You can write a Maven goal in maven.xml that issues the SHUTDOWN
command to the database (see sql ant task) , so you can call maven
shutdown and close the db.

<sql
    driver="org.database.jdbcDriver"
    url="jdbc:database-url"
    userid="sa"
    password="pass"
    >
SHUTDOWN;
</sql>

or maybe you can extend the Spring listener (or add another one to
web.xml) to issue that command when the webapp is unloaded.

Regards

Carlos Sanchez

On 5/26/05, Sebastien Arbogast <[hidden email]> wrote:

> Actually I found out how to access my JDBC connection and I wrote  the
> corresponding code but it appeared to be useless because my close()
> method was simply not called at all.
> So I'll give up with that as I have many other more important things
> to achieve on that project. For now I'll just restart the whole server
> every time and that's it...
>
> Anyway I sincerely thank you all for your help, despite the fact that
> this thread was not directly linked with maven.
>
> Bye
>
> --
> Sebastien ARBOGAST
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [hidden email]
> For additional commands, e-mail: [hidden email]
>
>

---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|

Re: HSQLDB locking when using tomcat plugin

Carlos Sanchez-2
<dependency>
           <groupId>hsqldb</groupId>
           <artifactId>hsqldb</artifactId>
           <version>1.7.3.3</version>
           <type>jar</type>
           <properties>
               <classloader>root</classloader>
               <war.bundle>true</war.bundle>
           </properties>
       </dependency>

Please send replies to maven users list.

On 5/26/05, Sebastien Arbogast <[hidden email]> wrote:

> 2005/5/26, Carlos Sanchez <[hidden email]>:
> > Try adding <classloader>root</classloader> under properties.
> > And if it works read http://maven.apache.org/faq.html#classloader-property
>
> What do you mean by "under properties" ? Where should I add this
> classloader element ?
>
> --
> Sebastien ARBOGAST
>

---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|

Re: HSQLDB locking when using tomcat plugin

Sebastien ARBOGAST
2005/5/26, Carlos Sanchez <[hidden email]>:

> <dependency>
>            <groupId>hsqldb</groupId>
>            <artifactId>hsqldb</artifactId>
>            <version>1.7.3.3</version>
>            <type>jar</type>
>            <properties>
>                <classloader>root</classloader>
>                <war.bundle>true</war.bundle>
>            </properties>
>        </dependency>
>
> Please send replies to maven users list.

Sorry ! Damn GMail answer...

Unfortunately it didn't work. It happened exactly what I was afraid of :

 __  __
|  \/  |__ _Apache__ ___
| |\/| / _` \ V / -_) ' \  ~ intelligent projects ~
|_|  |_\__,_|\_/\___|_||_|  v. 1.0.2

    [echo] Found context file C:\dev\myapp/target/webapp/META-INF/context.
xml
    [echo] /myapp file:C:\dev\myapp/target/webapp/META-INF/context.xml

BUILD FAILED
File...... C:\dev\myapp\maven.xml
Element... sql
Line...... 128
Column.... 28
java.sql.SQLException: The database is already in use by another process: org.hs
qldb.NIOLockFile@98c4b002[file =C:\dev\myapp\target\webapp\WEB-INF\db\scha
mandb.lck, exists=true, locked=false, valid=false, fl =null]: java.lang.Exceptio
n: Le processus ne peut pas accÚder au fichier car un autre processus en a verro
uillÚ une partie : C:\dev\myapp\target\webapp\WEB-INF\db\myappdb.lck
Total time: 8 seconds
Finished at: Thu May 26 18:57:09 CDT 2005

In fact, the problem is that this SHUTDOWN is called from another
thread that the one who accesses the database in the first place. :-(

--
Sebastien ARBOGAST

---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|

Re: HSQLDB locking when using tomcat plugin

Sebastien ARBOGAST
In reply to this post by Chad Brandon
> You can easily use AOP with MDA, I use aspectj with my AndroMDA apps all
> the time, because your system is generated does not mean you can't
> introduce aspects into the process.
>

Ok thanks for the precision Chad, I didn't know that and I didn't mean
to misinform people about AndroMDA. Use AndroMDA folks... AndroMDA is
good ! ;-)
The thing is I'm not ready to throw myself into some AOP I just don't
know anything about, just to work around some annoying database
restriction...

--
Sebastien ARBOGAST

---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]