-->
These old forums are deprecated now and set to read-only. We are waiting for you on our new forums!
More modern, Discourse-based and with GitHub/Google/Twitter authentication built-in.

All times are UTC - 5 hours [ DST ]



Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 12 posts ] 
Author Message
 Post subject: Several one to many tables
PostPosted: Wed Mar 10, 2010 1:54 pm 
Newbie

Joined: Wed Mar 10, 2010 1:44 pm
Posts: 7
Hi!

I have four tables with one to many relations between them. I can save and update data to the first two tables but i can't do it to the rest of the tables. I don't get an errormessage but nothing is added to the tables.

I have tried to google about my problem but i can't seem to find an answer. Please help me!

Regards

Daniel


Top
 Profile  
 
 Post subject: Re: Several one to many tables
PostPosted: Wed Mar 10, 2010 2:28 pm 
Expert
Expert

Joined: Wed Mar 03, 2004 6:35 am
Posts: 1240
Location: Lund, Sweden
It is not so easy to help you since you don't provide any information about your entities, mappings, database schema, test code, etc.


Top
 Profile  
 
 Post subject: Re: Several one to many tables
PostPosted: Thu Mar 11, 2010 5:50 am 
Newbie

Joined: Wed Mar 10, 2010 1:44 pm
Posts: 7
My hbm-files look like this;

Arkiv.hbm.xml

<?xml version="1.0"?>
<!DOCTYPE hibernate-mapping PUBLIC "-//Hibernate/Hibernate Mapping DTD 3.0//EN"
"http://hibernate.sourceforge.net/hibernate-mapping-3.0.dtd">
<!-- Generated 2010-jan-31 17:55:47 by Hibernate Tools 3.2.5.Beta -->
<hibernate-mapping>
<class name="com.beans.Arkiv" table="arkiv">
<id name="ID" type="int">
<column name="idArkiv" />
<generator class="increment" />
</id>
<set name="processes" cascade="all">
<key column="arkivID"/>
<one-to-many class="com.beans.Process"/>
</set>
<property name="namn" type="java.lang.String">
<column name="namnArkiv" />
</property>
</class>
</hibernate-mapping>


Process.hbm.xml
<?xml version="1.0"?>
<!DOCTYPE hibernate-mapping PUBLIC "-//Hibernate/Hibernate Mapping DTD 3.0//EN"
"http://hibernate.sourceforge.net/hibernate-mapping-3.0.dtd">
<!-- Generated 2010-jan-31 17:55:47 by Hibernate Tools 3.2.5.Beta -->
<hibernate-mapping>
<class name="com.beans.Process" table="process">
<id name="processID" type="int">
<column name="idProcess" />
<generator class="increment" />
</id>
<property name="processBeteckning" type="java.lang.String">
<column name="beteckningProcess" />
</property>
<property name="processNamn" type="java.lang.String">
<column name="namnProcess" />
</property>
<set name="set" cascade="all">
<key column="processID"/>
<one-to-many class="com.beans.Handlingsslag"/>
</set>
</class>
</hibernate-mapping>

Handlingsslag.hbm.xml
<?xml version="1.0"?>
<!DOCTYPE hibernate-mapping PUBLIC "-//Hibernate/Hibernate Mapping DTD 3.0//EN"
"http://hibernate.sourceforge.net/hibernate-mapping-3.0.dtd">
<!-- Generated 2010-feb-25 13:25:26 by Hibernate Tools 3.2.5.Beta -->
<hibernate-mapping>
<class name="com.beans.Handlingsslag" table="handlingsslag">
<id name="ID" type="int">
<column name="idHandlingsslag" />
<generator class="increment" />
</id>
<property name="namn" type="java.lang.String">
<column name="namnHandlingsslag" />
</property>
<property name="organisation" type="java.lang.String">
<column name="organisationHandlingsslag" />
</property>
<property name="gallring" type="java.lang.String">
<column name="gallringHandlingsslag" />
</property>
<property name="sekretess" type="java.lang.String">
<column name="sekretessHandlingsslag" />
</property>
<set name="handlingstyper" cascade="all">
<key column="handlingsslagsID"/>
<one-to-many class="com.beans.Handlingstyp"/>
</set>
</class>
</hibernate-mapping>

Handlingstyp.hbm.xml

<?xml version="1.0"?>
<!DOCTYPE hibernate-mapping PUBLIC
"-//Hibernate/Hibernate Mapping DTD 3.0//EN"
"http://hibernate.sourceforge.net/hibernate-mapping-3.0.dtd">
<hibernate-mapping package="com.beans">
<class name="com.beans.Handlingstyp" table="handlingstyp">
<id name="idHandlingstyp" type="int">
<column name="handlingstypID" />
<generator class="increment" />
</id>
<property name="handlingstyp" type="java.lang.String">
<column name="handlingstypNamn" />
</property>
</class>
</hibernate-mapping>

I'm trying to save to the database using this code:


public void sparaArkiv(){
p = (Process) FacesContext.getCurrentInstance().getExternalContext()
.getSessionMap().get("process");
p.setProcessBeteckning(p.getProcessBeteckning());
p.setProcessNamn(p.getProcessNamn());
HashSet<Process> set = new HashSet<Process>();
set.add(p);
a = (Arkiv) FacesContext.getCurrentInstance().getExternalContext()
.getSessionMap().get("arkiv");
a.setNamn(a.getNamn());
a.setProcesses(set);
lagraPost ("Arkiv.hbm.xml",a);
}

public void sparaProcess(){
h = (Handlingsslag) FacesContext.getCurrentInstance().getExternalContext()
.getSessionMap().get("handlingsslag");
h.setNamn(h.getNamn());
h.setOrganisation(h.getOrganisation());
h.setGallring(h.getGallring());
h.setSekretess(h.getSekretess());
HashSet<Handlingsslag> set = new HashSet<Handlingsslag>();
set.add(h);
p = (Process) FacesContext.getCurrentInstance().getExternalContext()
.getSessionMap().get("process");
p.setSet(set);
lagraPost ("Process.hbm.xml",p);
}

public void sparaHandlingsslag(){
h = (Handlingsslag) FacesContext.getCurrentInstance().getExternalContext()
.getSessionMap().get("handlingsslag");
h.setNamn(h.getNamn());
h.setOrganisation(h.getOrganisation());
h.setGallring(h.getGallring());
h.setSekretess(h.getSekretess());
ht = (Handlingstyp) FacesContext.getCurrentInstance().getExternalContext()
.getSessionMap().get("handlingstyp");
ht.setHandlingstyp(ht.getHandlingstyp());
HashSet<Handlingstyp> set = new HashSet<Handlingstyp>();
set.add(ht);
h.setHandlingstyper(set);
lagraPost ("Handlingsslag.hbm.xml",h);
}
public void sparaForvaringsenhet(){
f = (Forvaringsenhet) FacesContext.getCurrentInstance().getExternalContext()
.getSessionMap().get("forvaringsenhet");
f.setID(0);
f.setHandlingsslagID(0);
f.setBeteckning(f.getBeteckning());
f.setTyp(f.getTyp());
f.setTidsperiodstart(f.getTidsperiodstart());
f.setTidsperiodslut(f.getTidsperiodslut());
f.setPlacering(f.getPlacering());
lagraPost ("Forvaringsenhet.hbm.xml",f);
}

public void lagraPost(String resource, Object o){

Configuration c = new Configuration().configure();
try{
s = Anslutning.getSessionFactory().openSession();
s.beginTransaction();
s.saveOrUpdate(o);
s.getTransaction().commit();
}
catch (Exception e){
System.out.println(e.getMessage());
}
s.flush();
s.close();
}


Top
 Profile  
 
 Post subject: Re: Several one to many tables
PostPosted: Thu Mar 11, 2010 6:08 am 
Expert
Expert

Joined: Wed Mar 03, 2004 6:35 am
Posts: 1240
Location: Lund, Sweden
I don't understand your code. Why is for example every method full of calls like:
Code:
h.setNamn(h.getNamn());
h.setOrganisation(h.getOrganisation());


I don't understand the lagraPost() method. Why are you building a new Configuration in it? It can be rather time-consuming and should only be done one time when the application is starting up, not every time you want to save an object.

And you haven't provided any information about your problem. In your first post you write that:

Quote:
I can save and update data to the first two tables but i can't do it to the rest of the tables.


Which two can you update and which two doesn't work?


Top
 Profile  
 
 Post subject: Re: Several one to many tables
PostPosted: Thu Mar 11, 2010 6:44 am 
Newbie

Joined: Wed Mar 10, 2010 1:44 pm
Posts: 7
I can delete the configuration (it's left from an earlier attempt when the code was different).

I can update the first two, Arkiv and Process. My feeling is that i'm doing wrong when trying to update the third table since it is dependent on the second table by the foreign key. I can't just figure out how i should write the code.

Thanks in advance!


Top
 Profile  
 
 Post subject: Re: Several one to many tables
PostPosted: Thu Mar 11, 2010 7:08 am 
Expert
Expert

Joined: Wed Mar 03, 2004 6:35 am
Posts: 1240
Location: Lund, Sweden
Quote:
My feeling is that i'm doing wrong when trying to update the third table since it is dependent on the second table by the foreign key


Uhhmm.... not really... you have not mapped any dependency between Handlingsslag and Process. There is a relation in the other direction, but if you want a bi-directional association you need to map a <many-to-one> in the Handlingsslag entity.

It is possible to have uni-directional one-to-many associations but then you must always work with the parent entity. A bi-directional association is a lot easier to handle since the association is controlled by the child entity. I suggest that you read the parent/child example in the hibernate documentation: http://docs.jboss.org/hibernate/stable/ ... child.html

I don't still understand your code. When/where are you calling the various sparaXYZ() methods and what kind of objects do you get from FacesContext? Are they new objects or already existing in the database that was loaded in a different session?


Top
 Profile  
 
 Post subject: Re: Several one to many tables
PostPosted: Thu Mar 11, 2010 7:26 am 
Newbie

Joined: Wed Mar 10, 2010 1:44 pm
Posts: 7
I will read your recommendation.

The context of the code is Java Server Faces. I have a webappUI in which i register different kinds of archival information. I press a button in the UI which calls a method sparaPost(), which in return calls sparaArkiv(), sparaProcess() and so on. The objects (current instances) are from the fields in the form in the UI.

I'm not sure if this is clarifying but i hope so.


Top
 Profile  
 
 Post subject: Re: Several one to many tables
PostPosted: Thu Mar 11, 2010 7:32 am 
Newbie

Joined: Wed Mar 10, 2010 1:44 pm
Posts: 7
one more thing. I close the session after each call of sparaArkiv(), sparaProcess, sparaHandlingsslag(), sparaHandlingstyp. Perhaps i have to skip dividing the code into different methods and make one method which stores all information at once in one session.


Top
 Profile  
 
 Post subject: Re: Several one to many tables
PostPosted: Thu Mar 11, 2010 7:46 am 
Expert
Expert

Joined: Wed Mar 03, 2004 6:35 am
Posts: 1240
Location: Lund, Sweden
If you call each of the sparaXYZ methods after each other it is a lot better to have a single session. When you have changed that, please also post the SQL that hibernate generates.


Top
 Profile  
 
 Post subject: Re: Several one to many tables
PostPosted: Thu Mar 11, 2010 9:00 am 
Newbie

Joined: Wed Mar 10, 2010 1:44 pm
Posts: 7
A long clip from my console (using Glassfish as container), including SQL from Hibernate at the bottom of the list. Hibernate "complains" about the foreignkey column "processID" in the table "Handlingsslag" and it says something about a mismatch between my objects and the actual state in the database. I think i know why, the first saved object changes the state for the tables Arkiv and Process, after that am i trying to save Process again, now with a connection to the third table Handlingsslag. The problem is that I don't know how I should alter my code to get it right.

INFO: Server shutdown initiated

2010-mar-11 13:36:10 com.sun.enterprise.admin.launcher.GFLauncherLogger info
INFO: JVM invocation command line:
C:\Program Files\Java\jdk1.6.0_18\bin\java.exe
-cp
C:/GlassFish-Tools-Bundle-For-Eclipse-1.2/glassfishv3/glassfish/modules/glassfish.jar
-XX:+UnlockDiagnosticVMOptions
-XX:MaxPermSize=192m
-XX:NewRatio=2
-XX:+LogVMOutput
-XX:LogFile=C:\Users\Daniel\workspaceGlassfish\.metadata\.plugins\com.sun.enterprise.jst.server.sunappsrv92\domain1/logs/jvm.log
-Xmx512m
-client
-javaagent:C:/GlassFish-Tools-Bundle-For-Eclipse-1.2/glassfishv3/glassfish/lib/monitor/btrace-agent.jar=unsafe=true,noServer=true
-Dosgi.shell.telnet.maxconn=1
-Djdbc.drivers=org.apache.derby.jdbc.ClientDriver
-Dfelix.fileinstall.dir=C:\GlassFish-Tools-Bundle-For-Eclipse-1.2\glassfishv3\glassfish/modules/autostart/
-Djavax.net.ssl.keyStore=C:\Users\Daniel\workspaceGlassfish\.metadata\.plugins\com.sun.enterprise.jst.server.sunappsrv92\domain1/config/keystore.jks
-Dosgi.shell.telnet.port=6666
-Djava.security.policy=C:\Users\Daniel\workspaceGlassfish\.metadata\.plugins\com.sun.enterprise.jst.server.sunappsrv92\domain1/config/server.policy
-Dfelix.fileinstall.poll=5000
-Dcom.sun.aas.instanceRoot=C:\Users\Daniel\workspaceGlassfish\.metadata\.plugins\com.sun.enterprise.jst.server.sunappsrv92\domain1
-Dcom.sun.enterprise.config.config_environment_factory_class=com.sun.enterprise.config.serverbeans.AppserverConfigEnvironmentFactory
-Dosgi.shell.telnet.ip=127.0.0.1
-Djava.endorsed.dirs=C:\GlassFish-Tools-Bundle-For-Eclipse-1.2\glassfishv3\glassfish/modules/endorsed;C:\GlassFish-Tools-Bundle-For-Eclipse-1.2\glassfishv3\glassfish/lib/endorsed
-Dcom.sun.aas.installRoot=C:\GlassFish-Tools-Bundle-For-Eclipse-1.2\glassfishv3\glassfish
-Djava.ext.dirs=C:\Program Files\Java\jdk1.6.0_18/lib/ext;C:\Program Files\Java\jdk1.6.0_18/jre/lib/ext;C:\Users\Daniel\workspaceGlassfish\.metadata\.plugins\com.sun.enterprise.jst.server.sunappsrv92\domain1/lib/ext
-Dfelix.fileinstall.bundles.new.start=true
-Djavax.net.ssl.trustStore=C:\Users\Daniel\workspaceGlassfish\.metadata\.plugins\com.sun.enterprise.jst.server.sunappsrv92\domain1/config/cacerts.jks
-Dcom.sun.enterprise.security.httpsOutboundKeyAlias=s1as
-Djava.security.auth.login.config=C:\Users\Daniel\workspaceGlassfish\.metadata\.plugins\com.sun.enterprise.jst.server.sunappsrv92\domain1/config/login.conf
-DANTLR_USE_DIRECT_CLASS_LOADING=true
-Dfelix.fileinstall.debug=1
-Dorg.glassfish.web.rfc2109_cookie_names_enforced=false
-Djava.library.path=C:/GlassFish-Tools-Bundle-For-Eclipse-1.2/glassfishv3/glassfish/lib;C:/Program Files/Java/jdk1.6.0_18/bin;C:/GlassFish-Tools-Bundle-For-Eclipse-1.2/glassfishv3/glassfish;C:/Windows/Sun/Java/bin;C:/Windows/System32;C:/Windows;C:/GlassFish-Tools-Bundle-For-Eclipse-1.2/jre/jre/bin/client;C:/GlassFish-Tools-Bundle-For-Eclipse-1.2/jre/jre/bin;C:/Windows/System32/wbem;C:/Windows/System32/WindowsPowerShell/v1.0;C:/Program Files/WIDCOMM/Bluetooth Software;C:/Program Files/WIDCOMM/Bluetooth Software/syswow64;C:/Program Files (x86)/Common Files/Roxio Shared/10.0/DLLShared;C:/Program Files (x86)/Common Files/Roxio Shared/DLLShared;C:/GlassFish-Tools-Bundle-For-Eclipse-1.2/glassfishv3/glassfish/%M2%;C:/Program Files/apache-tomcat-6.0.24;C:/Användare/Daniel/workspace;C:/Sun/AppServer/bin;C:/Program Files/apache-maven-2.2.1/bin
com.sun.enterprise.glassfish.bootstrap.ASMain
-domainname
domain1
-asadmin-args
start-domain,,,--domaindir,,,C:\Users\Daniel\workspaceGlassfish\.metadata\.plugins\com.sun.enterprise.jst.server.sunappsrv92,,,--debug=false,,,--verbose=false,,,domain1
-instancename
server
-verbose
false
-debug
false
-asadmin-classpath
C:/GlassFish-Tools-Bundle-For-Eclipse-1.2/glassfishv3/glassfish/modules/admin-cli.jar
-asadmin-classname
com.sun.enterprise.admin.cli.AsadminMain
-upgrade
false
-domaindir
C:/Users/Daniel/workspaceGlassfish/.metadata/.plugins/com.sun.enterprise.jst.server.sunappsrv92/domain1
-read-stdin
true

INFO: JMXStartupService: Stopped JMXConnectorServer: service:jmx:rmi://192.168.77.38:8686/jndi/rmi://192.168.77.38:8686/jmxrmi
INFO: JMXStartupService and JMXConnectors have been shut down.
INFO: Shutdown procedure finished
2010-mar-11 13:36:10 com.sun.enterprise.admin.launcher.GFLauncherLogger info
INFO: Successfully launched in 16 msec.

INFO: Running GlassFish Version: GlassFish v3 (build 74.2)

INFO: Perform lazy SSL initialization for the listener 'http-listener-2'
INFO: Starting Grizzly Framework 1.9.18-k - Thu Mar 11 13:36:15 CET 2010
INFO: Starting Grizzly Framework 1.9.18-k - Thu Mar 11 13:36:15 CET 2010
INFO: Grizzly Framework 1.9.18-k started in: 78ms listening on port 3700
INFO: Grizzly Framework 1.9.18-k started in: 94ms listening on port 8181
INFO: Grizzly Framework 1.9.18-k started in: 109ms listening on port 4860
INFO: Grizzly Framework 1.9.18-k started in: 78ms listening on port 7676
INFO: Grizzly Framework 1.9.18-k started in: 187ms listening on port 8084

INFO: Using com.sun.enterprise.transaction.jts.JavaEETransactionManagerJTSDelegate as the delegate

INFO: javassist.util.proxy.ProxyFactory.classLoaderProvider = org.glassfish.weld.WeldActivator$GlassFishClassLoaderProvider@149ee0f1
INFO: SEC1002: Security Manager is OFF.
ALLVARLIG: SEC5054: Certificate has expired: [
[
Version: V1
Subject: OU=Secure Server Certification Authority, O="RSA Data Security, Inc.", C=US
Signature Algorithm: MD2withRSA, OID = 1.2.840.113549.1.1.2
Key: Sun RSA public key, 1000 bits
modulus: 6144706769222379850430183405655235862870193813433361902309516534729547168229223442088128897090426025874990958624426272027915771330043379079076269082776443120496525109458437435793974957144923190172655546279112796066635455545786300647745888353781002359412766112775410851780140804282673804950495744761467
public exponent: 65537
Validity: [From: Wed Nov 09 01:00:00 CET 1994,
To: Fri Jan 08 00:59:59 CET 2010]
Issuer: OU=Secure Server Certification Authority, O="RSA Data Security, Inc.", C=US
SerialNumber: [ 02ad667e 4e45fe5e 576f3c98 195eddc0]
]
Algorithm: [MD2withRSA]
Signature:
0000: 65 DD 7E E1 B2 EC B0 E2 3A E0 EC 71 46 9A 19 11 e.......:..qF...
0010: B8 D3 C7 A0 B4 03 40 26 02 3E 09 9C E1 12 B3 D1 ......@&.>......
0020: 5A F6 37 A5 B7 61 03 B6 5B 16 69 3B C6 44 08 0C Z.7..a..[.i;.D..
0030: 88 53 0C 6B 97 49 C7 3E 35 DC 6C B9 BB AA DF 5C .S.k.I.>5.l....\
0040: BB 3A 2F 93 60 B6 A9 4B 4D F2 20 F7 CD 5F 7F 64 .:/.`..KM. .._.d
0050: 7B 8E DC 00 5C D7 FA 77 CA 39 16 59 6F 0E EA D3 ....\..w.9.Yo...
0060: B5 83 7F 4D 4D 42 56 76 B4 C9 5F 04 F8 38 F8 EB ...MMBVv.._..8..
0070: D2 5F 75 5F CD 7B FC E5 8E 80 7C FC 50 ._u_........P
]
INFO: Security startup service called
INFO: SEC1143: Loading policy provider com.sun.enterprise.security.provider.PolicyWrapper.
INFO: Realm admin-realm of classtype com.sun.enterprise.security.auth.realm.file.FileRealm successfully created.
INFO: Realm file of classtype com.sun.enterprise.security.auth.realm.file.FileRealm successfully created.
INFO: Realm certificate of classtype com.sun.enterprise.security.auth.realm.certificate.CertificateRealm successfully created.
INFO: Security service(s) started successfully....

INFO: Created HTTP listener http-listener-1 on port 8084
INFO: Created HTTP listener http-listener-2 on port 8181
INFO: Created HTTP listener admin-listener on port 4860
INFO: Created virtual server server
INFO: Created virtual server server
INFO: Created virtual server __asadmin
INFO: Created virtual server __asadmin
INFO: Created virtual server __asadmin

INFO: Virtual server server loaded system default web module
INFO: Virtual server server loaded system default web module
INFO: Virtual server server loaded system default web module

INFO: Initializing Mojarra 2.0.2 (FCS b10) for context '/Anslutning'

INFO: Loading application Anslutning at /Anslutning
INFO: Loading application Anslutning at /Anslutning
INFO: Loading application Anslutning at /Anslutning
INFO: Loading Anslutning Application done is 10102 ms
INFO: GlassFish v3 (74.2) startup time : Felix(4496ms) startup services(10946ms) total(15442ms)

INFO: Binding RMI port to *:8686
INFO: [Thread[GlassFish Kernel Main Thread,5,main]] started
INFO: {felix.fileinstall.poll (ms) = 5000, felix.fileinstall.dir = C:\GlassFish-Tools-Bundle-For-Eclipse-1.2\glassfishv3\glassfish\modules\autostart, felix.fileinstall.debug = 1, felix.fileinstall.bundles.new.start = true, felix.fileinstall.tmpdir = C:\Users\Daniel\AppData\Local\Temp\fileinstall-3786507634884177452, felix.fileinstall.filter = null}
INFO: {felix.fileinstall.poll (ms) = 5000, felix.fileinstall.dir = C:\Users\Daniel\workspaceGlassfish\.metadata\.plugins\com.sun.enterprise.jst.server.sunappsrv92\domain1\autodeploy\bundles, felix.fileinstall.debug = 1, felix.fileinstall.bundles.new.start = true, felix.fileinstall.tmpdir = C:\Users\Daniel\AppData\Local\Temp\fileinstall--7674853482204875033, felix.fileinstall.filter = null}
INFO: JMXStartupService: Started JMXConnector, JMXService URL = service:jmx:rmi://192.168.77.38:8686/jndi/rmi://192.168.77.38:8686/jmxrmi

INFO: Updating configuration from org.apache.felix.fileinstall-autodeploy-bundles.cfg
INFO: Installed C:\GlassFish-Tools-Bundle-For-Eclipse-1.2\glassfishv3\glassfish\modules\autostart\org.apache.felix.fileinstall-autodeploy-bundles.cfg
INFO: {felix.fileinstall.poll (ms) = 5000, felix.fileinstall.dir = C:\Users\Daniel\workspaceGlassfish\.metadata\.plugins\com.sun.enterprise.jst.server.sunappsrv92\domain1\autodeploy\bundles, felix.fileinstall.debug = 1, felix.fileinstall.bundles.new.start = true, felix.fileinstall.tmpdir = C:\Users\Daniel\AppData\Local\Temp\fileinstall-3636100355768336675, felix.fileinstall.filter = null}

INFO: No context init parameter 'org.apache.myfaces.PRETTY_HTML' found, using default value true
INFO: No context init parameter 'org.apache.myfaces.ALLOW_JAVASCRIPT' found, using default value true
INFO: No context init parameter 'org.apache.myfaces.READONLY_AS_DISABLED_FOR_SELECTS' found, using default value true
INFO: No context init parameter 'org.apache.myfaces.RENDER_VIEWSTATE_ID' found, using default value true
INFO: No context init parameter 'org.apache.myfaces.STRICT_XHTML_LINKS' found, using default value true
INFO: No context init parameter 'org.apache.myfaces.CONFIG_REFRESH_PERIOD' found, using default value 2
INFO: No context init parameter 'org.apache.myfaces.DETECT_JAVASCRIPT' found, using default value false
INFO: No context init parameter 'org.apache.myfaces.AUTO_SCROLL' found, using default value false
INFO: No context init parameter 'org.apache.myfaces.ADD_RESOURCE_CLASS' found, using default value org.apache.myfaces.renderkit.html.util.DefaultAddResource
INFO: No context init parameter 'org.apache.myfaces.RESOURCE_VIRTUAL_PATH' found, using default value /faces/myFacesExtensionResource
INFO: No context init parameter 'org.apache.myfaces.CHECK_EXTENSIONS_FILTER' found, using default value true
INFO: Starting up Tomahawk on the RI-JSF-Implementation.
INFO: Starting up Tomahawk on the MyFaces-JSF-Implementation
ALLVARLIG: Both MyFaces and the RI are on your classpath. Please make sure to use only one of the two JSF-implementations.

ALLVARLIG: 62 [http-thread-pool-8084-(1)] INFO org.hibernate.cfg.Environment - Hibernate 3.3.0.SP1

ALLVARLIG: 62 [http-thread-pool-8084-(1)] INFO org.hibernate.cfg.Environment - hibernate.properties not found

ALLVARLIG: 78 [http-thread-pool-8084-(1)] INFO org.hibernate.cfg.Environment - Bytecode provider name : javassist

ALLVARLIG: 93 [http-thread-pool-8084-(1)] INFO org.hibernate.cfg.Environment - using JDK 1.4 java.sql.Timestamp handling

ALLVARLIG: 399 [http-thread-pool-8084-(1)] INFO org.hibernate.cfg.Configuration - configuring from resource: /hibernate.cfg.xml

ALLVARLIG: 399 [http-thread-pool-8084-(1)] INFO org.hibernate.cfg.Configuration - Configuration resource: /hibernate.cfg.xml


ALLVARLIG: 711 [http-thread-pool-8084-(1)] INFO org.hibernate.cfg.Configuration - Reading mappings from resource : Arkiv.hbm.xml

ALLVARLIG: 899 [http-thread-pool-8084-(1)] INFO org.hibernate.cfg.HbmBinder - Mapping class: com.beans.Arkiv -> arkiv

ALLVARLIG: 961 [http-thread-pool-8084-(1)] INFO org.hibernate.cfg.Configuration - Reading mappings from resource : Process.hbm.xml


ALLVARLIG: 992 [http-thread-pool-8084-(1)] INFO org.hibernate.cfg.HbmBinder - Mapping class: com.beans.Process -> process

ALLVARLIG: 992 [http-thread-pool-8084-(1)] INFO org.hibernate.cfg.Configuration - Reading mappings from resource : Handlingsslag.hbm.xml

ALLVARLIG: 1008 [http-thread-pool-8084-(1)] INFO org.hibernate.cfg.HbmBinder - Mapping class: com.beans.Handlingsslag -> handlingsslag

ALLVARLIG: 1008 [http-thread-pool-8084-(1)] INFO org.hibernate.cfg.Configuration - Reading mappings from resource : Handlingstyp.hbm.xml

ALLVARLIG: 1023 [http-thread-pool-8084-(1)] INFO org.hibernate.cfg.HbmBinder - Mapping class: com.beans.Handlingstyp -> handlingstyp

ALLVARLIG: 1023 [http-thread-pool-8084-(1)] INFO org.hibernate.cfg.Configuration - Reading mappings from resource : Forvaringsenhet.hbm.xml

ALLVARLIG: 1055 [http-thread-pool-8084-(1)] INFO org.hibernate.cfg.HbmBinder - Mapping class: com.beans.Forvaringsenhet -> forvaringsenhet

ALLVARLIG: 1055 [http-thread-pool-8084-(1)] INFO org.hibernate.cfg.Configuration - Configured SessionFactory:

ALLVARLIG: 1055 [http-thread-pool-8084-(1)] INFO org.hibernate.cfg.Configuration - configuring from resource: /hibernate.cfg.xml

ALLVARLIG: 1055 [http-thread-pool-8084-(1)] INFO org.hibernate.cfg.Configuration - Configuration resource: /hibernate.cfg.xml

ALLVARLIG: 1055 [http-thread-pool-8084-(1)] INFO org.hibernate.cfg.Configuration - Reading mappings from resource : Arkiv.hbm.xml

ALLVARLIG: 1070 [http-thread-pool-8084-(1)] INFO org.hibernate.cfg.HbmBinder - Mapping class: com.beans.Arkiv -> arkiv

ALLVARLIG: 1070 [http-thread-pool-8084-(1)] INFO org.hibernate.cfg.Configuration - Reading mappings from resource : Process.hbm.xml

ALLVARLIG: 1101 [http-thread-pool-8084-(1)] INFO org.hibernate.cfg.HbmBinder - Mapping class: com.beans.Process -> process

ALLVARLIG: 1101 [http-thread-pool-8084-(1)] INFO org.hibernate.cfg.Configuration - Reading mappings from resource : Handlingsslag.hbm.xml

ALLVARLIG: 1117 [http-thread-pool-8084-(1)] INFO org.hibernate.cfg.HbmBinder - Mapping class: com.beans.Handlingsslag -> handlingsslag

ALLVARLIG: 1117 [http-thread-pool-8084-(1)] INFO org.hibernate.cfg.Configuration - Reading mappings from resource : Handlingstyp.hbm.xml

ALLVARLIG: 1133 [http-thread-pool-8084-(1)] INFO org.hibernate.cfg.HbmBinder - Mapping class: com.beans.Handlingstyp -> handlingstyp

ALLVARLIG: 1133 [http-thread-pool-8084-(1)] INFO org.hibernate.cfg.Configuration - Reading mappings from resource : Forvaringsenhet.hbm.xml

ALLVARLIG: 1164 [http-thread-pool-8084-(1)] INFO org.hibernate.cfg.HbmBinder - Mapping class: com.beans.Forvaringsenhet -> forvaringsenhet

ALLVARLIG: 1164 [http-thread-pool-8084-(1)] INFO org.hibernate.cfg.Configuration - Configured SessionFactory:

ALLVARLIG: 1164 [http-thread-pool-8084-(1)] INFO org.hibernate.cfg.HbmBinder - Mapping collection: com.beans.Arkiv.processes -> process

ALLVARLIG: 1179 [http-thread-pool-8084-(1)] INFO org.hibernate.cfg.HbmBinder - Mapping collection: com.beans.Process.set -> handlingsslag

ALLVARLIG: 1179 [http-thread-pool-8084-(1)] INFO org.hibernate.cfg.HbmBinder - Mapping collection: com.beans.Handlingsslag.handlingstyper -> handlingstyp

ALLVARLIG: 1445 [http-thread-pool-8084-(1)] INFO org.hibernate.connection.DriverManagerConnectionProvider - Using Hibernate built-in connection pool (not for production use!)

ALLVARLIG: 1445 [http-thread-pool-8084-(1)] INFO org.hibernate.connection.DriverManagerConnectionProvider - Hibernate connection pool size: 20

ALLVARLIG: 1445 [http-thread-pool-8084-(1)] INFO org.hibernate.connection.DriverManagerConnectionProvider - autocommit mode: false

ALLVARLIG: 1460 [http-thread-pool-8084-(1)] INFO org.hibernate.connection.DriverManagerConnectionProvider - using driver: org.gjt.mm.mysql.Driver at URL: jdbc:mysql://localhost/arkivdatabas

ALLVARLIG: 1460 [http-thread-pool-8084-(1)] INFO org.hibernate.connection.DriverManagerConnectionProvider - connection properties: {user=root, password=****}


ALLVARLIG: 2162 [http-thread-pool-8084-(1)] INFO org.hibernate.cfg.SettingsFactory - RDBMS: MySQL, version: 5.1.36-community-log

ALLVARLIG: 2162 [http-thread-pool-8084-(1)] INFO org.hibernate.cfg.SettingsFactory - JDBC driver: MySQL-AB JDBC Driver, version: mysql-connector-java-5.1.11 ( Revision: ${svn.Revision} )

ALLVARLIG: 2615 [http-thread-pool-8084-(1)] INFO org.hibernate.dialect.Dialect - Using dialect: org.hibernate.dialect.MySQLInnoDBDialect

ALLVARLIG: 2630 [http-thread-pool-8084-(1)] INFO org.hibernate.transaction.TransactionFactoryFactory - Using default transaction strategy (direct JDBC transactions)

ALLVARLIG: 2646 [http-thread-pool-8084-(1)] INFO org.hibernate.transaction.TransactionManagerLookupFactory - No TransactionManagerLookup configured (in JTA environment, use of read-write or transactional second-level cache is not recommended)

ALLVARLIG: 2646 [http-thread-pool-8084-(1)] INFO org.hibernate.cfg.SettingsFactory - Automatic flush during beforeCompletion(): disabled

ALLVARLIG: 2646 [http-thread-pool-8084-(1)] INFO org.hibernate.cfg.SettingsFactory - Automatic session close at end of transaction: disabled

ALLVARLIG: 2646 [http-thread-pool-8084-(1)] INFO org.hibernate.cfg.SettingsFactory - JDBC batch size: 15

ALLVARLIG: 2646 [http-thread-pool-8084-(1)] INFO org.hibernate.cfg.SettingsFactory - JDBC batch updates for versioned data: disabled

ALLVARLIG: 2646 [http-thread-pool-8084-(1)] INFO org.hibernate.cfg.SettingsFactory - Scrollable result sets: enabled

ALLVARLIG: 2646 [http-thread-pool-8084-(1)] INFO org.hibernate.cfg.SettingsFactory - JDBC3 getGeneratedKeys(): enabled

ALLVARLIG: 2646 [http-thread-pool-8084-(1)] INFO org.hibernate.cfg.SettingsFactory - Connection release mode: auto

ALLVARLIG: 2646 [http-thread-pool-8084-(1)] INFO org.hibernate.cfg.SettingsFactory - Default schema: arkivdatabas

ALLVARLIG: 2646 [http-thread-pool-8084-(1)] INFO org.hibernate.cfg.SettingsFactory - Maximum outer join fetch depth: 2

ALLVARLIG: 2646 [http-thread-pool-8084-(1)] INFO org.hibernate.cfg.SettingsFactory - Default batch fetch size: 1

ALLVARLIG: 2646 [http-thread-pool-8084-(1)] INFO org.hibernate.cfg.SettingsFactory - Generate SQL with comments: disabled

ALLVARLIG: 2646 [http-thread-pool-8084-(1)] INFO org.hibernate.cfg.SettingsFactory - Order SQL updates by primary key: disabled

ALLVARLIG: 2646 [http-thread-pool-8084-(1)] INFO org.hibernate.cfg.SettingsFactory - Order SQL inserts for batching: disabled

ALLVARLIG: 2646 [http-thread-pool-8084-(1)] INFO org.hibernate.cfg.SettingsFactory - Query translator: org.hibernate.hql.ast.ASTQueryTranslatorFactory


ALLVARLIG: 2661 [http-thread-pool-8084-(1)] INFO org.hibernate.hql.ast.ASTQueryTranslatorFactory - Using ASTQueryTranslatorFactory

ALLVARLIG: 2661 [http-thread-pool-8084-(1)] INFO org.hibernate.cfg.SettingsFactory - Query language substitutions: {}

ALLVARLIG: 2661 [http-thread-pool-8084-(1)] INFO org.hibernate.cfg.SettingsFactory - JPA-QL strict compliance: disabled

ALLVARLIG: 2661 [http-thread-pool-8084-(1)] INFO org.hibernate.cfg.SettingsFactory - Second-level cache: enabled

ALLVARLIG: 2661 [http-thread-pool-8084-(1)] INFO org.hibernate.cfg.SettingsFactory - Query cache: disabled

ALLVARLIG: 2661 [http-thread-pool-8084-(1)] INFO org.hibernate.cfg.SettingsFactory - Cache region factory : org.hibernate.cache.impl.NoCachingRegionFactory

ALLVARLIG: 2661 [http-thread-pool-8084-(1)] INFO org.hibernate.cfg.SettingsFactory - Optimize cache for minimal puts: disabled

ALLVARLIG: 2661 [http-thread-pool-8084-(1)] INFO org.hibernate.cfg.SettingsFactory - Structured second-level cache entries: disabled

ALLVARLIG: 2693 [http-thread-pool-8084-(1)] INFO org.hibernate.cfg.SettingsFactory - Echoing all SQL to stdout

ALLVARLIG: 2693 [http-thread-pool-8084-(1)] INFO org.hibernate.cfg.SettingsFactory - Statistics: disabled

ALLVARLIG: 2693 [http-thread-pool-8084-(1)] INFO org.hibernate.cfg.SettingsFactory - Deleted entity synthetic identifier rollback: disabled

ALLVARLIG: 2693 [http-thread-pool-8084-(1)] INFO org.hibernate.cfg.SettingsFactory - Default entity-mode: pojo

ALLVARLIG: 2693 [http-thread-pool-8084-(1)] INFO org.hibernate.cfg.SettingsFactory - Named query checking : enabled

ALLVARLIG: 2864 [http-thread-pool-8084-(1)] INFO org.hibernate.impl.SessionFactoryImpl - building session factory


ALLVARLIG: 3644 [http-thread-pool-8084-(1)] INFO org.hibernate.impl.SessionFactoryObjectFactory - Factory name:

ALLVARLIG: 3644 [http-thread-pool-8084-(1)] INFO org.hibernate.util.NamingHelper - JNDI InitialContext properties:{}


ALLVARLIG: 3707 [http-thread-pool-8084-(1)] ERROR org.hibernate.impl.SessionFactoryObjectFactory - Invalid JNDI name:

ALLVARLIG: javax.naming.InvalidNameException: Cannot bind empty name
at com.sun.enterprise.naming.impl.TransientContext.rebind(TransientContext.java:293)
at com.sun.enterprise.naming.impl.SerialContextProviderImpl.rebind(SerialContextProviderImpl.java:92)
at com.sun.enterprise.naming.impl.LocalSerialContextProviderImpl.rebind(LocalSerialContextProviderImpl.java:96)
at com.sun.enterprise.naming.impl.SerialContext.rebind(SerialContext.java:619)
at com.sun.enterprise.naming.impl.SerialContext.rebind(SerialContext.java:635)
at javax.naming.InitialContext.rebind(InitialContext.java:412)
at javax.naming.InitialContext.rebind(InitialContext.java:412)
at org.hibernate.util.NamingHelper.bind(NamingHelper.java:97)
at org.hibernate.impl.SessionFactoryObjectFactory.addInstance(SessionFactoryObjectFactory.java:113)
at org.hibernate.impl.SessionFactoryImpl.<init>(SessionFactoryImpl.java:338)
at org.hibernate.cfg.Configuration.buildSessionFactory(Configuration.java:1327)
at com.beans.Anslutning.<clinit>(Anslutning.java:12)
at com.beans.SparaPost.lagraPost(SparaPost.java:85)
at com.beans.SparaPost.sparaArkiv(SparaPost.java:35)
at com.beans.SparaPost.sparaPost(SparaPost.java:97)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at com.sun.el.parser.AstValue.invoke(AstValue.java:234)
at com.sun.el.MethodExpressionImpl.invoke(MethodExpressionImpl.java:297)
at javax.faces.component.MethodBindingMethodExpressionAdapter.invoke(MethodBindingMethodExpressionAdapter.java:88)
at com.sun.faces.application.ActionListenerImpl.processAction(ActionListenerImpl.java:102)
at javax.faces.component.UICommand.broadcast(UICommand.java:315)
at javax.faces.component.UIViewRoot.broadcastEvents(UIViewRoot.java:775)
at javax.faces.component.UIViewRoot.processApplication(UIViewRoot.java:1267)
at com.sun.faces.lifecycle.InvokeApplicationPhase.execute(InvokeApplicationPhase.java:82)
at com.sun.faces.lifecycle.Phase.doPhase(Phase.java:101)
at com.sun.faces.lifecycle.LifecycleImpl.execute(LifecycleImpl.java:118)
at javax.faces.webapp.FacesServlet.service(FacesServlet.java:312)
at org.apache.catalina.core.StandardWrapper.service(StandardWrapper.java:1523)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:279)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:188)
at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:641)
at com.sun.enterprise.web.WebPipeline.invoke(WebPipeline.java:97)
at com.sun.enterprise.web.PESessionLockingStandardPipeline.invoke(PESessionLockingStandardPipeline.java:85)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:185)
at org.apache.catalina.connector.CoyoteAdapter.doService(CoyoteAdapter.java:332)
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:233)
at com.sun.enterprise.v3.services.impl.ContainerMapper.service(ContainerMapper.java:165)
at com.sun.grizzly.http.ProcessorTask.invokeAdapter(ProcessorTask.java:791)
at com.sun.grizzly.http.ProcessorTask.doProcess(ProcessorTask.java:693)
at com.sun.grizzly.http.ProcessorTask.process(ProcessorTask.java:954)
at com.sun.grizzly.http.DefaultProtocolFilter.execute(DefaultProtocolFilter.java:170)
at com.sun.grizzly.DefaultProtocolChain.executeProtocolFilter(DefaultProtocolChain.java:135)
at com.sun.grizzly.DefaultProtocolChain.execute(DefaultProtocolChain.java:102)
at com.sun.grizzly.DefaultProtocolChain.execute(DefaultProtocolChain.java:88)
at com.sun.grizzly.http.HttpProtocolChain.execute(HttpProtocolChain.java:76)
at com.sun.grizzly.ProtocolChainContextTask.doCall(ProtocolChainContextTask.java:53)
at com.sun.grizzly.SelectionKeyContextTask.call(SelectionKeyContextTask.java:57)
at com.sun.grizzly.ContextTask.run(ContextTask.java:69)
at com.sun.grizzly.util.AbstractThreadPool$Worker.doWork(AbstractThreadPool.java:330)
at com.sun.grizzly.util.AbstractThreadPool$Worker.run(AbstractThreadPool.java:309)
at java.lang.Thread.run(Thread.java:619)

INFO: Hibernate: select max(idArkiv) from arkivdatabas.arkiv
INFO: Hibernate: select max(idProcess) from arkivdatabas.process
INFO: Hibernate: select max(idHandlingsslag) from arkivdatabas.handlingsslag
INFO: Hibernate: select max(handlingstypID) from arkivdatabas.handlingstyp
INFO: Hibernate: insert into arkivdatabas.arkiv (namnArkiv, idArkiv) values (?, ?)
INFO: Hibernate: insert into arkivdatabas.process (beteckningProcess, namnProcess, idProcess) values (?, ?, ?)
INFO: Hibernate: insert into arkivdatabas.handlingsslag (namnHandlingsslag, organisationHandlingsslag, gallringHandlingsslag, sekretessHandlingsslag, idHandlingsslag) values (?, ?, ?, ?, ?)
ALLVARLIG: 4003 [http-thread-pool-8084-(1)] WARN org.hibernate.util.JDBCExceptionReporter - SQL Error: 1364, SQLState: HY000

ALLVARLIG: 4003 [http-thread-pool-8084-(1)] ERROR org.hibernate.util.JDBCExceptionReporter - Field 'processID' doesn't have a default value

ALLVARLIG: 4003 [http-thread-pool-8084-(1)] ERROR org.hibernate.event.def.AbstractFlushingEventListener - Could not synchronize database state with session

ALLVARLIG: org.hibernate.exception.GenericJDBCException: Could not execute JDBC batch update
at org.hibernate.exception.SQLStateConverter.handledNonSpecificException(SQLStateConverter.java:126)
at org.hibernate.exception.SQLStateConverter.convert(SQLStateConverter.java:114)
at org.hibernate.exception.JDBCExceptionHelper.convert(JDBCExceptionHelper.java:66)
at org.hibernate.jdbc.AbstractBatcher.executeBatch(AbstractBatcher.java:275)
at org.hibernate.jdbc.AbstractBatcher.prepareStatement(AbstractBatcher.java:114)
at org.hibernate.jdbc.AbstractBatcher.prepareStatement(AbstractBatcher.java:109)
at org.hibernate.jdbc.AbstractBatcher.prepareBatchStatement(AbstractBatcher.java:244)
at org.hibernate.persister.entity.AbstractEntityPersister.insert(AbstractEntityPersister.java:2252)
at org.hibernate.persister.entity.AbstractEntityPersister.insert(AbstractEntityPersister.java:2688)
at org.hibernate.action.EntityInsertAction.execute(EntityInsertAction.java:79)
at org.hibernate.engine.ActionQueue.execute(ActionQueue.java:279)
at org.hibernate.engine.ActionQueue.executeActions(ActionQueue.java:263)
at org.hibernate.engine.ActionQueue.executeActions(ActionQueue.java:167)
at org.hibernate.event.def.AbstractFlushingEventListener.performExecutions(AbstractFlushingEventListener.java:321)
at org.hibernate.event.def.DefaultFlushEventListener.onFlush(DefaultFlushEventListener.java:50)
at org.hibernate.impl.SessionImpl.flush(SessionImpl.java:1027)
at org.hibernate.impl.SessionImpl.managedFlush(SessionImpl.java:365)
at org.hibernate.transaction.JDBCTransaction.commit(JDBCTransaction.java:137)
at com.beans.SparaPost.lagraPost(SparaPost.java:88)
at com.beans.SparaPost.sparaArkiv(SparaPost.java:35)
at com.beans.SparaPost.sparaPost(SparaPost.java:97)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at com.sun.el.parser.AstValue.invoke(AstValue.java:234)
at com.sun.el.MethodExpressionImpl.invoke(MethodExpressionImpl.java:297)
at javax.faces.component.MethodBindingMethodExpressionAdapter.invoke(MethodBindingMethodExpressionAdapter.java:88)
at com.sun.faces.application.ActionListenerImpl.processAction(ActionListenerImpl.java:102)
at javax.faces.component.UICommand.broadcast(UICommand.java:315)
at javax.faces.component.UIViewRoot.broadcastEvents(UIViewRoot.java:775)
at javax.faces.component.UIViewRoot.processApplication(UIViewRoot.java:1267)
at com.sun.faces.lifecycle.InvokeApplicationPhase.execute(InvokeApplicationPhase.java:82)
at com.sun.faces.lifecycle.Phase.doPhase(Phase.java:101)
at com.sun.faces.lifecycle.LifecycleImpl.execute(LifecycleImpl.java:118)
at javax.faces.webapp.FacesServlet.service(FacesServlet.java:312)
at org.apache.catalina.core.StandardWrapper.service(StandardWrapper.java:1523)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:279)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:188)
at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:641)
at com.sun.enterprise.web.WebPipeline.invoke(WebPipeline.java:97)
at com.sun.enterprise.web.PESessionLockingStandardPipeline.invoke(PESessionLockingStandardPipeline.java:85)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:185)
at org.apache.catalina.connector.CoyoteAdapter.doService(CoyoteAdapter.java:332)
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:233)
at com.sun.enterprise.v3.services.impl.ContainerMapper.service(ContainerMapper.java:165)
at com.sun.grizzly.http.ProcessorTask.invokeAdapter(ProcessorTask.java:791)
at com.sun.grizzly.http.ProcessorTask.doProcess(ProcessorTask.java:693)
at com.sun.grizzly.http.ProcessorTask.process(ProcessorTask.java:954)
at com.sun.grizzly.http.DefaultProtocolFilter.execute(DefaultProtocolFilter.java:170)
at com.sun.grizzly.DefaultProtocolChain.executeProtocolFilter(DefaultProtocolChain.java:135)
at com.sun.grizzly.DefaultProtocolChain.execute(DefaultProtocolChain.java:102)
at com.sun.grizzly.DefaultProtocolChain.execute(DefaultProtocolChain.java:88)
at com.sun.grizzly.http.HttpProtocolChain.execute(HttpProtocolChain.java:76)
at com.sun.grizzly.ProtocolChainContextTask.doCall(ProtocolChainContextTask.java:53)
at com.sun.grizzly.SelectionKeyContextTask.call(SelectionKeyContextTask.java:57)
at com.sun.grizzly.ContextTask.run(ContextTask.java:69)
at com.sun.grizzly.util.AbstractThreadPool$Worker.doWork(AbstractThreadPool.java:330)
at com.sun.grizzly.util.AbstractThreadPool$Worker.run(AbstractThreadPool.java:309)
at java.lang.Thread.run(Thread.java:619)
Caused by: java.sql.BatchUpdateException: Field 'processID' doesn't have a default value
at com.mysql.jdbc.PreparedStatement.executeBatchSerially(PreparedStatement.java:2015)
at com.mysql.jdbc.PreparedStatement.executeBatch(PreparedStatement.java:1451)
at org.hibernate.jdbc.BatchingBatcher.doExecuteBatch(BatchingBatcher.java:70)
at org.hibernate.jdbc.AbstractBatcher.executeBatch(AbstractBatcher.java:268)
... 56 more

INFO: Could not execute JDBC batch update


Top
 Profile  
 
 Post subject: Re: Several one to many tables
PostPosted: Thu Mar 11, 2010 2:32 pm 
Expert
Expert

Joined: Wed Mar 03, 2004 6:35 am
Posts: 1240
Location: Lund, Sweden
I think this is just a different but similar error to what is mentioned about not null constraints in the parent/child example. It is a lot easier to work with <many-to-one> associations than with <one-to-many> so I suggest that you add <many-to-one> mappings from each child to it's parent. Add inverse="true" to all <one-to-many> associations. Then update your code according to the parent/child example so that both ends of the association are set correctly.


Top
 Profile  
 
 Post subject: Re: Several one to many tables
PostPosted: Sat Mar 13, 2010 4:15 am 
Newbie

Joined: Wed Mar 10, 2010 1:44 pm
Posts: 7
You were right! My problems updating the tables were caused by a not-null constraint for the foreign key.

Now it works. Thanks for your help!


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 12 posts ] 

All times are UTC - 5 hours [ DST ]


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
© Copyright 2014, Red Hat Inc. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc.