DDL in transactions?
| От | Giuseppe Sacco |
|---|---|
| Тема | DDL in transactions? |
| Дата | |
| Msg-id | 1112254334.3881.8.camel@localhost обсуждение исходный текст |
| Ответы |
Re: DDL in transactions?
|
| Список | pgsql-jdbc |
Hi,
I have a question about 7.4 jdbc driver. I am executing this code:
--------------------
conn=datasource.getPooledConnection().getConnection();
conn.setAutoCommit(false);
stmt=conn.createStatement();
stmt.executeUpdate("CREATE TABLE X (X VARCHAR(100))");
//stmt.commit(); // <= Look at this line
stmt.executeUpdate("INSERT INTO X VALUES ('string')");
stmt.commit();
stmt.close();
conn.close();
--------------------
And I found that, using postgresql jdbc driver, I need to add the
commit() call that is commented out, otherwise I get an error like
'relation X does not exists'.
My question is: why? Shouldn't DDL be executed immediately?
Thank you for your response,
Giuseppe Sacco
В списке pgsql-jdbc по дате отправления: