<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:dc="http://purl.org/dc/elements/1.1/" version="2.0">
  <channel>
    <title>Hibernate-Problem</title>
    <link>http://forum.geizhals.at/feed.jsp?id=535592</link>
    <description>Geizhals-Forum</description>
    <item>
      <title>Re(4): Hibernate-Problem</title>
      <link>http://forum.geizhals.at/t535592,4469410.html#4469410</link>
      <description>Danke, für die Antworten, aber ich hab die Lösung gefunden:&lt;br&gt;Bei der HSQLDB gibt es mehrere Files, darunter eine Datei &lt;dbname/&gt;.script&lt;br&gt;Und die schreibt man&lt;br&gt;&lt;br&gt;SET WRITE_DELAY 0 MILLIS&lt;br&gt;&lt;br&gt;Dann klappt's.&lt;br&gt;&lt;br/&gt;</description>
      <pubDate>Sun, 25 Nov 2007 21:33:00 GMT</pubDate>
      <guid>http://forum.geizhals.at/t535592,4469410.html#4469410</guid>
      <dc:creator>eibe</dc:creator>
      <dc:date>2007-11-25T21:33:00Z</dc:date>
    </item>
    <item>
      <title>Re(3): Hibernate-Problem</title>
      <link>http://forum.geizhals.at/t535592,4469316.html#4469316</link>
      <description>Hast du denn mit dem HSQL Manager überprüft, wieviele es wirklich sind?&lt;br&gt;Und Exceptions gibts auch keine (verschluckt oder so)?&lt;br/&gt;</description>
      <pubDate>Sun, 25 Nov 2007 20:33:50 GMT</pubDate>
      <guid>http://forum.geizhals.at/t535592,4469316.html#4469316</guid>
      <dc:creator>komplexler</dc:creator>
      <dc:date>2007-11-25T20:33:50Z</dc:date>
    </item>
    <item>
      <title>Re(2): Hibernate-Problem</title>
      <link>http://forum.geizhals.at/t535592,4469289.html#4469289</link>
      <description>Danke für den Tipp, aber das funkt leider auch nicht.&lt;br&gt;Ebenso hilft ein flush() der Transaction nichts.&lt;br/&gt;</description>
      <pubDate>Sun, 25 Nov 2007 20:18:20 GMT</pubDate>
      <guid>http://forum.geizhals.at/t535592,4469289.html#4469289</guid>
      <dc:creator>eibe</dc:creator>
      <dc:date>2007-11-25T20:18:20Z</dc:date>
    </item>
    <item>
      <title>Re: Hibernate-Problem</title>
      <link>http://forum.geizhals.at/t535592,4469193.html#4469193</link>
      <description>Und wennst Hibernate die Session managen lässt, &lt;br&gt;also mit getCurrentSession()?&lt;br&gt;&lt;br&gt;siehe auch &lt;a href="http://www.hibernate.org/42.html" rel="noopener" target="_blank"&gt;http:/&lt;wbr/&gt;/&lt;wbr/&gt;www.hibernate.org/&lt;wbr/&gt;42.html&lt;/a&gt; &lt;br&gt;vielleicht hilfts ja was&lt;br/&gt;</description>
      <pubDate>Sun, 25 Nov 2007 19:11:56 GMT</pubDate>
      <guid>http://forum.geizhals.at/t535592,4469193.html#4469193</guid>
      <dc:creator>komplexler</dc:creator>
      <dc:date>2007-11-25T19:11:56Z</dc:date>
    </item>
    <item>
      <title>Hibernate-Problem</title>
      <link>http://forum.geizhals.at/t535592,4468666.html#4468666</link>
      <description>Hi!&lt;br&gt;&lt;br&gt;Ich habe ein Problem mit Hibernate und zwar werden nicht alle Datensätze in einer HSQLDB gespeichert. Im konkreten Fall nur 96 statt 100.&lt;br&gt;&lt;br&gt;Das Problem liegt anscheined, dass zwischen dem commit einer Transaction und dem close() der Session ein paar Sekunden vergehen müssen.&lt;br&gt;Erst dann werden die letzten Datensätze geschrieben.&lt;br&gt;Kann man so einen Timeout konfigurieren oder liegt das Problem wo anders?&lt;br&gt;&lt;br&gt;Bin für jeden Tipp dankbar.&lt;br&gt;&lt;br&gt;Hier der Code dazu:&lt;br&gt;&lt;br&gt;&lt;br&gt;&lt;div class=code&gt;&lt;pre&gt;&#xD;
import java.io.IOException;&#xD;
import java.util.Calendar;&#xD;
&#xD;
import org.hibernate.Session;&#xD;
import org.hibernate.SessionFactory;&#xD;
import org.hibernate.Transaction;&#xD;
import org.hibernate.cfg.AnnotationConfiguration;&#xD;
&#xD;
&#xD;
public class TestWorkingTime {&#xD;
&#xD;
	public static void main(String[] args) {&#xD;
		AnnotationConfiguration configuration = new AnnotationConfiguration();&#xD;
		configuration.configure();&#xD;
		SessionFactory sessionFactory = configuration.buildSessionFactory();&#xD;
		Session session = sessionFactory.openSession();&#xD;
		Transaction transaction = session.beginTransaction();&#xD;
		for (int i=0; i&amp;lt;100; i++) {&#xD;
			WorkingTime wt = new WorkingTime();&#xD;
			wt.setDate(Calendar.getInstance().getTime());&#xD;
			session.save(wt);&#xD;
		}&#xD;
		try {&#xD;
			transaction.commit();&#xD;
			System.in.read();&#xD;
			session.close();&#xD;
			sessionFactory.close();&#xD;
		} catch (IOException e) {&#xD;
			e.printStackTrace();&#xD;
		}&#xD;
	}&#xD;
&#xD;
}&#xD;
&lt;/pre&gt;&lt;/div&gt;&lt;br&gt;&lt;br&gt;Und die Hibernate-Config:&lt;br&gt;&lt;br&gt;&lt;div class=code&gt;&lt;pre&gt;&#xD;
&amp;lt;?xml version='1.0' encoding='utf-8'?&amp;gt;&#xD;
&amp;lt;!DOCTYPE hibernate-configuration PUBLIC&#xD;
        "-//Hibernate/Hibernate Configuration DTD 3.0//EN"&#xD;
        "http://hibernate.sourceforge.net/hibernate-configuration-3.0.dtd"&amp;gt;&#xD;
&#xD;
&amp;lt;hibernate-configuration&amp;gt;&#xD;
&#xD;
    &amp;lt;session-factory&amp;gt;&#xD;
&#xD;
        &amp;lt;!-- Database connection settings --&amp;gt;&#xD;
        &amp;lt;property name="connection.driver_class"&amp;gt;org.hsqldb.jdbcDriver&amp;lt;/property&amp;gt;&#xD;
        &amp;lt;property name="connection.url"&amp;gt;jdbc:hsqldb:file:myhibdb&amp;lt;/property&amp;gt;&#xD;
        &amp;lt;property name="connection.username"&amp;gt;sa&amp;lt;/property&amp;gt;&#xD;
        &amp;lt;property name="connection.password"&amp;gt;&amp;lt;/property&amp;gt;&#xD;
        &#xD;
        &amp;lt;!-- JDBC connection pool (use the built-in) --&amp;gt;&#xD;
        &amp;lt;property name="connection.pool_size"&amp;gt;1&amp;lt;/property&amp;gt;&#xD;
&#xD;
        &amp;lt;!-- SQL dialect --&amp;gt;&#xD;
        &amp;lt;property name="dialect"&amp;gt;org.hibernate.dialect.HSQLDialect&amp;lt;/property&amp;gt;&#xD;
&#xD;
        &amp;lt;!-- Enable Hibernate's automatic session context management --&amp;gt;&#xD;
        &amp;lt;property name="current_session_context_class"&amp;gt;thread&amp;lt;/property&amp;gt;&#xD;
&#xD;
        &amp;lt;!-- Disable the second-level cache  --&amp;gt;&#xD;
        &amp;lt;property name="cache.provider_class"&amp;gt;org.hibernate.cache.NoCacheProvider&amp;lt;/property&amp;gt;&#xD;
&#xD;
        &amp;lt;!-- Echo all executed SQL to stdout --&amp;gt;&#xD;
        &amp;lt;property name="show_sql"&amp;gt;true&amp;lt;/property&amp;gt;&#xD;
&#xD;
        &amp;lt;!-- Drop and re-create the database schema on startup --&amp;gt;&#xD;
        &amp;lt;property name="hbm2ddl.auto"&amp;gt;create&amp;lt;/property&amp;gt;&#xD;
        &#xD;
        &amp;lt;property name="hibernate.format_sql"&amp;gt;true&amp;lt;/property&amp;gt;&#xD;
        &#xD;
        &amp;lt;!-- Auflistung der gemappten Klassen --&amp;gt;&#xD;
        &amp;lt;mapping class="WorkingTime"/&amp;gt;&#xD;
   &#xD;
&#xD;
    &amp;lt;/session-factory&amp;gt;&#xD;
&#xD;
&amp;lt;/hibernate-configuration&amp;gt;&#xD;
&lt;/pre&gt;&lt;/div&gt;&lt;br&gt;&lt;br/&gt;</description>
      <pubDate>Sun, 25 Nov 2007 13:07:03 GMT</pubDate>
      <guid>http://forum.geizhals.at/t535592,4468666.html#4468666</guid>
      <dc:creator>eibe</dc:creator>
      <dc:date>2007-11-25T13:07:03Z</dc:date>
    </item>
  </channel>
</rss>
