Thursday, March 3, 2016

org.postgresql.util.PSQLException: ERROR: DROP XXXXXX cannot run inside a transaction block

If your connection to database is set auto commit to false, once you commit, all the transactions will be run as a block.

      Connection conn = getConnection();
      conn.setAutoCommit(false);

Certain SQL statement cannot run in a transaction block. so you need to set auto commit to true of your connection for these commands to successfully execute. Examples of such commands are

      CREATE database
      DROP database
      DROP tablespace
      VACUUM

-----------------------------------------------------------------------------------------------------

                        
If you have ever asked yourself these questions, this is the book for you. What is the meaning of life? Why do people suffer? What is in control of my life? Why is life the way it is? How can I stop suffering and be happy? How can I have a successful life? How can I have a life I like to have? How can I be the person I like to be? How can I be wiser and smarter? How can I have good and harmonious relations with others? Why do people meditate to achieve enlightenment? What is the true meaning of spiritual practice? Why all beings are one? Read the book free here.

No comments:

Post a Comment