Database, sample data

View: New views
9 Messages — Rating Filter:   Alert me  

Database, sample data

by Kaan Yamanyar-2 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Hi all,

I downloaded trails today and I like it. I am using in memory database
and not planning to use mysql or another in developing environment.

Every time I restart the application, all data entered is removed. I
guess tables are constructed from scratch. Is there configuration to
prevent that rather then dumping the content and run that script every
time?

kr,
Kaan

---------------------------------------------------------------------
To unsubscribe from this list please visit:

    http://xircles.codehaus.org/manage_email


Re: Database, sample data

by Alejandro Scandroli :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Hi Kan

You can switch from in memory DB to a database file.
In hibernate.properties change the "hibernate.connection.url" property
to something like:
hibernate.connection.url=jdbc:hsqldb:file:/home/kan/theplacewereistoremydb/trails;shutdown=true

Here you can find all the HSQLDB connection options :
http://hsqldb.org/doc/guide/ch04.html#N108D2

Welcome to Trails!

--
Alejandro Scandroli - http://weblog.amneris.es/
Amneris: We build process-driven web applications.
http://www.amneris.es

On Feb 1, 2008 4:48 PM, Kaan Yamanyar <kaan@...> wrote:

> Hi all,
>
> I downloaded trails today and I like it. I am using in memory database
> and not planning to use mysql or another in developing environment.
>
> Every time I restart the application, all data entered is removed. I
> guess tables are constructed from scratch. Is there configuration to
> prevent that rather then dumping the content and run that script every
> time?
>
> kr,
> Kaan
>
> ---------------------------------------------------------------------
> To unsubscribe from this list please visit:
>
>     http://xircles.codehaus.org/manage_email
>
>

---------------------------------------------------------------------
To unsubscribe from this list please visit:

    http://xircles.codehaus.org/manage_email


Re: Database, sample data

by Kaan Yamanyar-2 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Hi Alejandro,

Thank you very much for your help.

KR,
Kaan

On 2/1/08, Alejandro Scandroli <alejandroscandroli@...> wrote:

> Hi Kan
>
> You can switch from in memory DB to a database file.
> In hibernate.properties change the "hibernate.connection.url" property
> to something like:
> hibernate.connection.url=jdbc:hsqldb:file:/home/kan/theplacewereistoremydb/trails;shutdown=true
>
> Here you can find all the HSQLDB connection options :
> http://hsqldb.org/doc/guide/ch04.html#N108D2
>
> Welcome to Trails!
>
> --
> Alejandro Scandroli - http://weblog.amneris.es/
> Amneris: We build process-driven web applications.
> http://www.amneris.es
>
> On Feb 1, 2008 4:48 PM, Kaan Yamanyar <kaan@...> wrote:
> > Hi all,
> >
> > I downloaded trails today and I like it. I am using in memory database
> > and not planning to use mysql or another in developing environment.
> >
> > Every time I restart the application, all data entered is removed. I
> > guess tables are constructed from scratch. Is there configuration to
> > prevent that rather then dumping the content and run that script every
> > time?
> >
> > kr,
> > Kaan
> >
> > ---------------------------------------------------------------------
> > To unsubscribe from this list please visit:
> >
> >     http://xircles.codehaus.org/manage_email
> >
> >
>
> ---------------------------------------------------------------------
> To unsubscribe from this list please visit:
>
>    http://xircles.codehaus.org/manage_email
>
>

---------------------------------------------------------------------
To unsubscribe from this list please visit:

    http://xircles.codehaus.org/manage_email


Trails session timeout definition

by Toby78 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Hi there!

How/where is the Trails session timeout defined?

I have set the Tapesty timeout to 1 minute:

  <session-config>
  <session-timeout>1</session-timeout>
  </session-config>
 
But after 1 minute, you are still logged in.

I have also set the timeout inside the trails_user table to a time 2 minutes in the future - and 3 minutes later I was still logged in.

Thanks!

Tobias


---------------------------------------------------------------------
To unsubscribe from this list, please visit:

    http://xircles.codehaus.org/manage_email



RE: Trails session timeout definition

by nhhockeyplayer :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Hi Tobias,
 
Thats a general web question.
 
Typically it goes at the bottom of your web.xml, as shown in this link.
 
http://www.adp-gmbh.ch/java/web_application/web_xml.html

Best regards
Ken in nashua



> Date: Wed, 13 Feb 2008 14:33:23 +0100
> From: superoverdrive@...
> To: users@...
> Subject: [trails-users] Trails session timeout definition
>
> Hi there!
>
> How/where is the Trails session timeout defined?
>
> I have set the Tapesty timeout to 1 minute:
>
> <session-config>
> <session-timeout>1</session-timeout>
> </session-config>
>
> But after 1 minute, you are still logged in.
>
> I have also set the timeout inside the trails_user table to a time 2 minutes in the future - and 3 minutes later I was still logged in.
>
> Thanks!
>
> Tobias
>
>
> ---------------------------------------------------------------------
> To unsubscribe from this list, please visit:
>
> http://xircles.codehaus.org/manage_email
>
>



Shed those extra pounds with MSN and The Biggest Loser! Learn more.
Best regards
Ken in nashua

Re: RE: Trails session timeout definition

by Toby78 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

I thought the org.trails.security.ExpiringKeyAuthenticationProvider always "extends" the timeout and logs you in again?

-------- Original-Nachricht --------
> Datum: Wed, 13 Feb 2008 08:36:28 -0500
> Von: Ken in nashua <nhhockeyplayer@...>
> An: users@...
> Betreff: RE: [trails-users] Trails session timeout definition

>
> Hi Tobias,
>  
> Thats a general web question.
>  
> Typically it goes at the bottom of your web.xml, as shown in this link.
>  
> http://www.adp-gmbh.ch/java/web_application/web_xml.htmlBest regards Ken
> in nashua> Date: Wed, 13 Feb 2008 14:33:23 +0100> From:
> superoverdrive@...> To: users@...> Subject: [trails-users] Trails session
> timeout definition> > Hi there!> > How/where is the Trails session timeout
> defined?> > I have set the Tapesty timeout to 1 minute:> > <session-config>>
> <session-timeout>1</session-timeout>> </session-config>> > But after 1
> minute, you are still logged in.> > I have also set the timeout inside the
> trails_user table to a time 2 minutes in the future - and 3 minutes later I was
> still logged in.> > Thanks!> > Tobias> > >
> ---------------------------------------------------------------------> To unsubscribe from this list,
> please visit:> > http://xircles.codehaus.org/manage_email> >
> _________________________________________________________________
> Shed those extra pounds with MSN and The Biggest Loser!
> http://biggestloser.msn.com/

---------------------------------------------------------------------
To unsubscribe from this list, please visit:

    http://xircles.codehaus.org/manage_email



RE: Trails session timeout definition

by nhhockeyplayer :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Yeah, I wasn't aware of timeout override.
 
But I did find the logic in trails-security (Kalle's dept)
 

// persistenceService.removeAll(credentials) won't work. When remember me is used, there may be several incoming requests that are sending the same

// token as credentials. If we invalidate the token after the first request, the second request fails, the request

// is redirected to the the login page, but that request is authenticated with the new cookie and so we go to

// an infinite loop. Instead, make the credentials expire soon (for example less than session timeout)

// Assume there's only one credential in the list. Expired credentials will be cleaned up later in any case

if (credentials.size() > 0) {

ExpiringKey credential = credentials.get(0);

// Expire in one min

credential.setExpiresAfter(new Date((new Date()).getTime() + 60000L));

persistenceService.save(credential);

}
 
Other than the above logic, which attempts to deal with contentious cookie access... I see no explicit timeout override logic.
 
You can setup a session listener in the web app to tear things down... this is again general web and you can set it up on your own for the web app.
 
http://www.java2s.com/Code/Java/Servlets/Servletsessionlistener.htm
 
I have not had to deal with this kind of thing and my answer maybe off.
 
I am sure Kalle could set you straight.


Best regards
Ken in nashua



> Date: Wed, 13 Feb 2008 14:39:48 +0100
> From: superoverdrive@...
> To: users@...
> Subject: Re: RE: [trails-users] Trails session timeout definition
>
> I thought the org.trails.security.ExpiringKeyAuthenticationProvider always "extends" the timeout and logs you in again?
>
> -------- Original-Nachricht --------
> > Datum: Wed, 13 Feb 2008 08:36:28 -0500
> > Von: Ken in nashua <nhhockeyplayer@...>
> > An: users@...
> > Betreff: RE: [trails-users] Trails session timeout definition
>
> >
> > Hi Tobias,
> >
> > Thats a general web question.
> >
> > Typically it goes at the bottom of your web.xml, as shown in this link.
> >
> > http://www.adp-gmbh.ch/java/web_application/web_xml.htmlBest regards Ken
> > in nashua> Date: Wed, 13 Feb 2008 14:33:23 +0100> From:
> > superoverdrive@...> To: users@...> Subject: [trails-users] Trails session
> > timeout definition> > Hi there!> > How/where is the Trails session timeout
> > defined?> > I have set the Tapesty timeout to 1 minute:> > <session-config>>
> > <session-timeout>1</session-timeout>> </session-config>> > But after 1
> > minute, you are still logged in.> > I have also set the timeout inside the
> > trails_user table to a time 2 minutes in the future - and 3 minutes later I was
> > still logged in.> > Thanks!> > Tobias> > >
> > ---------------------------------------------------------------------> To unsubscribe from this list,
> > please visit:> > http://xircles.codehaus.org/manage_email> >
> > _________________________________________________________________
> > Shed those extra pounds with MSN and The Biggest Loser!
> > http://biggestloser.msn.com/
>
> ---------------------------------------------------------------------
> To unsubscribe from this list, please visit:
>
> http://xircles.codehaus.org/manage_email
>
>



Helping your favorite cause is as easy as instant messaging. You IM, we give. Learn more.
Best regards
Ken in nashua

RE: Trails session timeout definition

by nhhockeyplayer :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

My take on functional remember-me logic is as follows:
 
If your session has not timed out, and you have a remember-me cookie persisted... then trails logs you back in automatically. This does occur for me though I have not tested session timeout.
 
Should one override the other? I guess that could be worked into the design. Kalle is the man for trails-security.
 
- cheers

Best regards
Ken in nashua



> Date: Wed, 13 Feb 2008 14:39:48 +0100
> From: superoverdrive@...
> To: users@...
> Subject: Re: RE: [trails-users] Trails session timeout definition
>
> I thought the org.trails.security.ExpiringKeyAuthenticationProvider always "extends" the timeout and logs you in again?
>
> -------- Original-Nachricht --------
> > Datum: Wed, 13 Feb 2008 08:36:28 -0500
> > Von: Ken in nashua <nhhockeyplayer@...>
> > An: users@...
> > Betreff: RE: [trails-users] Trails session timeout definition
>
> >
> > Hi Tobias,
> >
> > Thats a general web question.
> >
> > Typically it goes at the bottom of your web.xml, as shown in this link.
> >
> > http://www.adp-gmbh.ch/java/web_application/web_xml.htmlBest regards Ken
> > in nashua> Date: Wed, 13 Feb 2008 14:33:23 +0100> From:
> > superoverdrive@...> To: users@...> Subject: [trails-users] Trails session
> > timeout definition> > Hi there!> > How/where is the Trails session timeout
> > defined?> > I have set the Tapesty timeout to 1 minute:> > <session-config>>
> > <session-timeout>1</session-timeout>> </session-config>> > But after 1
> > minute, you are still logged in.> > I have also set the timeout inside the
> > trails_user table to a time 2 minutes in the future - and 3 minutes later I was
> > still logged in.> > Thanks!> > Tobias> > >
> > ---------------------------------------------------------------------> To unsubscribe from this list,
> > please visit:> > http://xircles.codehaus.org/manage_email> >
> > _________________________________________________________________
> > Shed those extra pounds with MSN and The Biggest Loser!
> > http://biggestloser.msn.com/
>
> ---------------------------------------------------------------------
> To unsubscribe from this list, please visit:
>
> http://xircles.codehaus.org/manage_email
>
>



Connect and share in new ways with Windows Live. Get it now!
Best regards
Ken in nashua

Re: Trails session timeout definition

by Kalle Korhonen-2 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Session and "being logged-in" are not necessarily the same concepts. If you are using remember me, you'd be logged in again automatically after your session expires. The container expires your session if it has not served new requests for that ssession within the timeout, but it's not necessarily super-exact. Are you sure there were no new request after you started timing? I'd wait for a few minutes longer before checking. You cannot set the session timeout "inside the trails_user table" (with plain Trails). Expiring, rolling tokens means you get a new remember me cookie every time you log in. If you used an existing remember me cookie, that token will be expired shortly after a log in, and a new token issued for you. Again, the expiration of the token only refers to the time limit within which it's valid for logging in again.

Kalle


On Feb 13, 2008 5:33 AM, <superoverdrive@...> wrote:
Hi there!

How/where is the Trails session timeout defined?

I have set the Tapesty timeout to 1 minute:

 <session-config>
       <session-timeout>1</session-timeout>
 </session-config>

But after 1 minute, you are still logged in.

I have also set the timeout inside the trails_user table to a time 2 minutes in the future - and 3 minutes later I was still logged in.

Thanks!

Tobias


---------------------------------------------------------------------
To unsubscribe from this list, please visit:

   http://xircles.codehaus.org/manage_email



LightInTheBox - Buy quality products at wholesale price!