Thread: data from the table is getting dropped when I am restarting my application after making changes in the objects created in my application in play
data from the table is getting dropped when I am restarting my application after making changes in the objects created in my application in play
From
rajonrole@gmail.com
Date:
I am creating one application using play in the models I had created a table and everything is working fine except when imake changes in any of the object(fields) all the previous data in the database is getting dropped how to recover that
Re: data from the table is getting dropped when I am restarting my application after making changes in the objects created in my application in play
From
Adrian Klaver
Date:
On 07/18/2012 12:19 PM, rajonrole@gmail.com wrote: > I am creating one application using play in the models I had created a table and everything is working fine except wheni make changes in any of the object(fields) all the previous data in the database is getting dropped how to recover that > This is going to need a lot more information to get an answer. In the meantime I am going to assume when you say play you mean: http://www.playframework.org/ My guess is you will find an answer sooner using the mailing list for the above: https://groups.google.com/forum/#!forum/play-framework -- Adrian Klaver adrian.klaver@gmail.com
Re: data from the table is getting dropped when I am restarting my application after making changes in the objects created in my application in play
From
Craig Ringer
Date:
On 07/19/2012 03:19 AM, rajonrole@gmail.com wrote: > I am creating one application using play in the models I had created a table and everything is working fine except wheni make changes in any of the object(fields) all the previous data in the database is getting dropped how to recover that > You're better off asking the Play! framework people. If you want to investigate it from the database side, set log_statement='all' in postgresql.conf, reload or restart PostgreSQL, and run your test. Now examine the logs and trace what the framework did. Check to see if: - It ever connects to PostgreSQL at all. You might be using an in-memory h2 or derby instance and just think you're using PostgreSQL - It ever inserts any data - It ever commits its transactions If you confirm that it's getting its data into PostgreSQL, you then need to look and see if it's deleting it again by checking the log for DELETE and TRUNCATE statements. It could also be re-creating your tables every time it runs. Check for "CREATE TABLE" statements. -- Craig Ringer
Re: data from the table is getting dropped when I am restarting my application after making changes in the objects created in my application in play
From
Craig Ringer
Date:
On 07/20/2012 05:54 PM, Roshan Saxena wrote:
Yes it is connect and insertion and udation and deletion is taking place normally but the proble of table drop occurs when I make any changes in my models in play
Please reply to the mailing list (reply all) not to me directly.
If Play framework is issuing a DROP TABLE, then you need to ask for help with the Play people. PostgreSQL has no way of knowing that you don't want the DROP TABLE your framework asks for.
On Thu, Jul 19, 2012 at 9:25 AM, Craig Ringer <ringerc@ringerc.id.au> wrote:
On 07/19/2012 03:19 AM, rajonrole@gmail.com wrote:You're better off asking the Play! framework people.I am creating one application using play in the models I had created a table and everything is working fine except when i make changes in any of the object(fields) all the previous data in the database is getting dropped how to recover that
If you want to investigate it from the database side, set log_statement='all' in postgresql.conf, reload or restart PostgreSQL, and run your test. Now examine the logs and trace what the framework did. Check to see if:
- It ever connects to PostgreSQL at all. You might be using an in-memory h2 or derby instance and just think you're using PostgreSQL
- It ever inserts any data
- It ever commits its transactions
If you confirm that it's getting its data into PostgreSQL, you then need to look and see if it's deleting it again by checking the log for DELETE and TRUNCATE statements.
It could also be re-creating your tables every time it runs. Check for "CREATE TABLE" statements.
--
Craig Ringer