jdbc-postgres

Why does Hibernate execute select currval in persist occasionally?

生来就可爱ヽ(ⅴ<●) 提交于 2020-04-14 07:37:09
问题 Sometimes and seems randomly Hibernate executes query like that during persist operation: select currval('MY_TABLE_NAME_id_seq'); Entity: @Entity @Table(name = "MY_TABLE_NAME") public class MyEntity { @Id @Column(name = "ID", unique = true, nullable = false) @GeneratedValue(strategy=GenerationType.IDENTITY) private Long id; } Code: @Transactional public void persistMyEntity(String name) { MyEntity entity= new MyEntity (name); sessionFactory.getCurrentSession().persist(entity); } Generated sql

Why does Hibernate execute select currval in persist occasionally?

雨燕双飞 提交于 2020-04-14 07:37:01
问题 Sometimes and seems randomly Hibernate executes query like that during persist operation: select currval('MY_TABLE_NAME_id_seq'); Entity: @Entity @Table(name = "MY_TABLE_NAME") public class MyEntity { @Id @Column(name = "ID", unique = true, nullable = false) @GeneratedValue(strategy=GenerationType.IDENTITY) private Long id; } Code: @Transactional public void persistMyEntity(String name) { MyEntity entity= new MyEntity (name); sessionFactory.getCurrentSession().persist(entity); } Generated sql

no postgresql user name specified in startup packet

╄→尐↘猪︶ㄣ 提交于 2019-12-10 17:41:02
问题 public class HelloPostgreSQLActivity extends Activity { TextView resultArea; @Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); resultArea = new TextView(this); resultArea.setText("Please wait."); setContentView(resultArea); new FetchSQL().execute(); } private class FetchSQL extends AsyncTask <Void,Void,String> { @Override protected String doInBackground(Void... params) { //TextView tv=(TextView)findViewById(R.id.text); String retval = ""; //

How do I log postgres driver messages with slf4j?

南楼画角 提交于 2019-12-08 19:57:18
问题 I'm using postgres db in my webapp. I added following dependencies in my pom.xml : <dependency> <groupId>org.slf4j</groupId> <artifactId>slf4j-api</artifactId> <version>1.7.5</version> </dependency> <dependency> <groupId>org.slf4j</groupId> <artifactId>jul-to-slf4j</artifactId> <version>1.7.5</version> </dependency> <dependency> <groupId>ch.qos.logback</groupId> <artifactId>logback-classic</artifactId> <version>1.0.13</version> </dependency> In IntelliJ Idea console log I see the following