From dd903bcdf2c50ae59287545e5ac477b40a9ea94d Mon Sep 17 00:00:00 2001 From: hns Date: Fri, 2 Mar 2001 15:50:43 +0000 Subject: [PATCH] We need to do something about db sources that are not defined... --- src/helma/objectmodel/DbMapping.java | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/helma/objectmodel/DbMapping.java b/src/helma/objectmodel/DbMapping.java index 4cc031cc..9ed9ca6d 100644 --- a/src/helma/objectmodel/DbMapping.java +++ b/src/helma/objectmodel/DbMapping.java @@ -97,8 +97,13 @@ public class DbMapping { this.idgen = props.getProperty ("_idgen"); String sourceName = props.getProperty ("_datasource"); - if (sourceName != null) + if (sourceName != null) { source = (DbSource) IServer.dbSources.get (sourceName.toLowerCase ()); + if (source == null) { + // what we really want to do here is mark the DbMapping as invalid, so no data can be saved to it. + // throw new RuntimeException ("DbSource \""+sourceName+"\" not found for prototype "+typename); + } + } // id field must not be null, default is "id" idField = props.getProperty ("_id", "id");