每当我部署具有外部化配置错误的生产应用程序时,我在Tomcat日志中收到以下消息:
log4j:WARN No appenders could be found for logger (org.codehaus.groovy.grails.commons.cfg.ConfigurationHelper)
log4j:WARN Please initialize the log4j system properly.
log4j:WARN See http://logging.apache.org/log4j/1.2/faq.html#noconfig for more info.
Run Code Online (Sandbox Code Playgroud)
显然,在正确初始化log4j之前处理外部化配置,因此没有可用于接受消息的appender ConfigurationHelper.
有没有办法在标准Grails log4j初始化发生之前预先初始化log4j以捕获这些消息?
前段时间,我为我目前工作的公司创建了一个自定义CMS.我们公司有多个部门,每个部门都要考虑到.与A部门合作的人只能访问被认为适合他们的文件.B部门也是如此.有些文件可以用于两个部门.我想避免的,这样而不是在一个部门一个特定的文档组B的记录和基本相同的记录大多是重复的记录,不过,我使用的位与操作来处理请求.
相关表格信息如下:
DOCUMENT Table
ID NAME DIVISIONS
-----------------------------------
1 Document 1 3
2 Document 2 2
3 Document 3 1
DIVISIONS Table
ID DIVISION
-------------------
1 DIVISION A
2 DIVISION B
Run Code Online (Sandbox Code Playgroud)
以下查询:
SELECT A.NAME, B.DIVISION
FROM DOCUMENT AS A
LEFT OUTER JOIN DIVISIONS AS B ON LAND(A.DIVISIONS,B.ID)=B.ID
WHERE B.DIVISION='DIVISION A'
Run Code Online (Sandbox Code Playgroud)
会产生结果集:
NAME DIVISION
------------------------
Document 1 DIVISION A
Document 3 DIVISION A
Run Code Online (Sandbox Code Playgroud)
同样,当B.DIVISION ='DIVISION B'时,以下结果集
NAME DIVISION
------------------------
Document 1 DIVISION B
Document 2 DIVISION B
Run Code Online (Sandbox Code Playgroud)
对于我的用途,这很好,没有明显的减速.但在更大的环境中,缺乏关键关系可能会损害这些交易的速度.而且,在我们放弃一个部门的机会中保持参照完整性变得更加困难.
有没有办法让外键实际上是两个值的函数?虽然这个特殊问题与我公司的iSeries(AS400)和iSeries的DB2有关,但它确实是一个可以为任何DBMS解决的问题.提前致谢.
我已经使用NuGet 安装了System.Data.SQLite.Core包,如FAQ中的System.Data.SQLite中所述:(5)是否有NuGet包?.
如何在Visual Studio 2013中启用设计时支持?

我正在使用 CentOS 5.6 版(最终版)和 PHP 5.1.6(cli)(构建时间:2012 年 2 月 2 日 18:24:47)。我需要与同一本地网络中的 DB2 数据库服务器连接。db2 版本是 V5R3。我已经安装了 iSeriesAccess 客户端和 unixODBC。
我的 odbc.ini 配置:
[iSeries Access ODBC Driver]
Description = iSeries Access for Linux ODBC Driver
Driver = /opt/ibm/iSeriesAccess/lib/libcwbodbc.so
Setup = /opt/ibm/iSeriesAccess/lib/libcwbodbcs.so
NOTE1 = If using unixODBC 2.2.11 or later and you want the 32 and 64-bit ODBC drivers to share DSN's,
NOTE2 = the following Driver64/Setup64 keywords will provide that support.
Driver64 = /opt/ibm/iSeriesAccess/lib64/libcwbodbc.so
Setup64 = /opt/ibm/iSeriesAccess/lib64/libcwbodbcs.so
Threading = 2
DontDLClose …Run Code Online (Sandbox Code Playgroud) 我将ReactiveList绑定到视图代码隐藏中的ComboBox并获取错误System.Exception:'找不到'Value1'的视图..
ViewModel.cs
public class SourceItem
{
public override string ToString()
{
return Name;
}
public string Name { get; set; }
}
public class ViewModel : ReactiveObject
{
public ReactiveList<SourceItem> SourceList { get; } = new ReactiveList<SourceItem>();
public SourceItem SelectedSourceItem { get; set; }
public ViewModel()
{
SourceList.Add(new SourceItem() {Name = "Value1"});
}
}
Run Code Online (Sandbox Code Playgroud)
View.xaml
<ComboBox Name="Source"/>
Run Code Online (Sandbox Code Playgroud)
View.cs
this.OneWayBind(ViewModel, x => x.SourceList, x => x.Source.ItemSource);
this.Bind(ViewModel, x => x.SelectedSourceItem, x => x.Source.SelectedItem);
Run Code Online (Sandbox Code Playgroud)
是否有一种强制ToString()用于显示值的简单方法?