Search Results

Search found 6357 results on 255 pages for 'generic relations'.

Page 125/255 | < Previous Page | 121 122 123 124 125 126 127 128 129 130 131 132  | Next Page >

  • again about JPA/Hibernate bulk(batch) insert

    - by abovesun
    Here is simple example I've created after reading several topics about jpa bulk inserts, I have 2 persistent objects User, and Site. One user could have many site, so we have one to many relations here. Suppose I want to create user and create/link several sites to user account. Here is how code looks like, considering my willing to use bulk insert for Site objects. User user = new User("John Doe"); user.getSites().add(new Site("google.com", user)); user.getSites().add(new Site("yahoo.com", user)); EntityTransaction tx = entityManager.getTransaction(); tx.begin(); entityManager.persist(user); tx.commit(); But when I run this code (I'm using hibernate as jpa implementation provider) I see following sql output: Hibernate: insert into User (id, name) values (null, ?) Hibernate: call identity() Hibernate: insert into Site (id, url, user_id) values (null, ?, ?) Hibernate: call identity() Hibernate: insert into Site (id, url, user_id) values (null, ?, ?) Hibernate: call identity() So, I means "real" bulk insert not works or I am confused? Here is source code for this example project, this is maven project so you have only download and run mvn install to check output.

    Read the article

  • Ubuntu hibernate resume fails: "PM: Resume from disk failed"

    - by Neil
    I just upgraded to Ubuntu 10.4 from 9.10, and it's now hiding the hibernate and suspend options. How do I get them back? So the way you do this is make sure that your swap partition is in /etc/fstab and swap is enabled, and big enough. Look at /proc/swaps to see if anything is listed. Now I'm getting this error when I boot after suspending: init: ureadahead-other main process (705) terminated with status 4 Does anyone know how to fix this? I'm using Ubuntu with kernel 2.6.32-22-generic.

    Read the article

  • ASP.NET Wizard control with Dynamic UserControls

    - by wjat777
    Hello everyone I'm trying to use the Wizard control as follows: 1 - In the first step (first screen) has a cheklistbox with several options 2 - For each option selected, will be created an extra step 3 - In some steps may be set up intermediate stages Me problem is that each step is a usercontrol. So if the first step I select option1 and option3, I should create two more steps with usercontrol1 and UserControl3 .... Someone already did something similar? I will try explain better the problem. I'll paste here, but I put a copy of the project in skydrive: http://cid-3d949f1661d00819.skydrive.live.com/self.aspx/C%5E3/WizardControl2.7z It is a very basic example of what I'm trying to do. The project has page.ASPX 1 and 3 usercontrol.ASCX (UC1, UC2 and UC3) Default.ASPX: <%@ Page Language="C#" AutoEventWireup="true" CodeBehind="Default.aspx.cs" Inherits="WebApplication2._Default" % Option1 Option2 Option3 Code Behind: using System; using System.Collections.Generic; using System.Linq; using System.Web; using System.Web.UI; using System.Web.UI.WebControls; namespace WebApplication2 { public partial class _Default : System.Web.UI.Page { protected void Page_Load(object sender, EventArgs e) { } protected void Page_PreInit(object sender, EventArgs e) { LoadSteps(); } private void LoadSteps() { int count = Wizard1.WizardSteps.Count; for (int i = count - 1; i > 0; i--) { WizardStepBase step = Wizard1.WizardSteps[i]; if (step.StepType != WizardStepType.Start) Wizard1.WizardSteps.Remove(step); } string Activities=""; foreach (ListItem item in CheckBoxList1.Items) { if (item.Selected) { WizardStep step = new WizardStep {ID = "step_" + item.Value, Title = "step_" + item.Value}; UserControl uc=null; switch (item.Value) { case "1": uc=(UserControl)LoadControl("~/UC1.ascx"); break; case "2": uc=(UserControl)LoadControl("~/UC2.ascx"); break; case "3": uc=(UserControl)LoadControl("~/UC3.ascx"); break; } step.Controls.Add(uc); Wizard1.WizardSteps.Add(step); } } } protected void CheckBoxList1_SelectedIndexChanged(object sender, EventArgs e) { LoadSteps(); } } } Control UC1.ASCX to UC3.ASCX has the same code (as an example) usercontrol.ascx: <%@ Control Language="C#" AutoEventWireup="true" CodeBehind="UC1.ascx.cs" Inherits="WebApplication2.UC1" % AutoPostBack="True" AutoPostBack="True" Code Behind: using System; using System.Collections.Generic; using System.Linq; using System.Web; using System.Web.UI; using System.Web.UI.WebControls; namespace WebApplication2 { public partial class UC1 : System.Web.UI.UserControl { protected void Page_Init(object sender, EventArgs e) { List list1 = new List { "Alice", "Bob", "Chris" }; List list2 = new List { "UN", "DEUX", "TROIS" }; DropDownList1.DataSource = list1; DropDownList2.DataSource = list2; DropDownList1.DataBind(); DropDownList2.DataBind(); } protected void Page_Load(object sender, EventArgs e) { if (IsPostBack) return; } protected void DropDownList1_SelectedIndexChanged(object sender, EventArgs e) { Label1.Text = DropDownList1.SelectedValue; } protected void DropDownList2_SelectedIndexChanged(object sender, EventArgs e) { Label2.Text = DropDownList2.SelectedValue; } } } You can see that the controls UserControls trigger events (they cause postbacks) The behavior of this project is a little different than I described in the first thread, but the problem is the same. After the second time "next" button, you will get an error. Thanks in advance William

    Read the article

  • Error: "failed to connect to wpa_supplicant - wpa_ctrl_open no such file or directory" using netcfg with wpa_supplicant

    - by user1576628
    I'm trying to set up netcfg so that I can finish installing Arch Linux (using the instructions from the Beginners' Guide and netcfg) and I passed over what was meant to be a short step. Open wifi-menu, select network, enter password. After multiple attempts, I decided to edit the profile manually, which yielded no improvement. Eventually I decided to use netfcg with the more familiar wpa_supplicant. My /etc/wpa_supplicant.conf file is as follows: network={ ssid="my_ssid" #psk="my_wireless_passcode" psk="my_wireless_passcode_hex" } (Replacing generic names with my actual ssid and psk.) And my /etc/network.d/wpa_suppl file reads: CONNECTION='wireless' DESCRIPTION='A wpa_supplicant configuration based wireless connection' INTERFACE='wlan0' SECURITY='wpa-config' WPA_CONF='/etc/wpa_supplicant.conf' IP='dhcp' My ssid is not hidden, wlan0 is the proper interface, and wpa_supplicant works fine on its own, but using netcfg wpa_suppl, it returns failed to connect to wpa_supplicant - wpa_ctrl_open no such file or directory about twelve times before finally telling me the authentication failed. What can I do to fix this?

    Read the article

  • ServerFault Wiki: How does Subnetting Work?

    - by Kyle Brandt
    How does Subnetting Work, and How do you do it by hand or in your head? Can someone explain both conceptually and with several examples? Serverfault gets lots of subnetting homework questions, so we could use an answer to point them to on serverfault itself. If I have a network, how do I figure out how to split it up? If I am given a netmask, how do I know what the network Range is for it? Sometimes there is a slash followed by a number, what is that number? Sometimes there is a subnet mask, but also a wildcard mask, they seem like the same thing but they are different? Someone mentioned something about knowing binary for this? Not looking for links to other sites (unless maybe you have one post with a bunch of good ones). I already know how to subnet, I just thought it would be nice if serverfault had a generic subnetting answer.

    Read the article

  • Proliant ML350 Won't Load Windows

    - by Mike
    I have a HP Proliant ML350 G4 running Windows 2003 Server Std Edition that will not load Windows on boot. It gave me a BSOD while running a recent Windows update and has not been able to boot since. The BSOD was a generic error, "Hardware Fault. Contact vendor." I am not getting any errors when the machine boots--it just hangs with a black screen when Windows starts to load. The machine will not boot into safe mode either--it gets stuck after beginning to load drivers. When trying to load the Windows recovery console I get the message that Windows cannot find any hard disks on the machine. This, despite having to load the driver for my storage controller. The HP Smart Start diagnostics finds no problems with my hard disks nor anything else. What should I try next? Mainly, I just want to be able to pull the data off my hard disks.

    Read the article

  • Why does mpstat show different values when I use the interval setting?

    - by Abe
    Here's the output I get when I run mpstat: $mpstat Linux 3.2.0-30-generic (my-laptop-C650) 09/17/2012 _x86_64_ (2 CPU) 05:32:01 PM CPU %usr %nice %sys %iowait %irq %soft %steal %guest %idle 05:32:01 PM all 9.16 0.08 2.69 2.00 0.00 0.04 0.00 0.00 86.02 And here's what I get when I run it with a one-second interval: $mpstat 1 05:31:51 PM CPU %usr %nice %sys %iowait %irq %soft %steal %guest %idle 05:31:52 PM all 1.52 0.00 1.01 0.00 0.00 0.00 0.00 0.00 97.47 05:31:53 PM all 2.04 0.00 1.02 0.00 0.00 0.00 0.00 0.00 96.94 05:31:54 PM all 1.50 0.00 1.50 0.00 0.00 0.00 0.00 0.00 97.00 Why does the first process show the processor as 86% idle, and the second show it as ~97% idle? I've tried this in a bunch of different configurations, and it's not a real difference in CPU usage -- unless mpstat itself is making the difference. Which number should I trust?

    Read the article

  • Windows 7 video driver for Intel 82865G graphics chipset

    - by Nick Kavadias
    I have an old Dell Inspirion 3000 which came with Windows XP. It's still quite decent, 3 GHz P4, 2 GB RAM. I've installed windows 7 RTM (x86) & the best resolution it will do is 640x480 with a generic driver. It has an integrated Intel 8265G graphics card, and only PCI slots on the motherboard. I cannot stick another graphics card on it. Can I get a working driver for Windows 7? Official Dell website only lists XP drivers Am I destined to have the suckiness of XP on this computer forever?

    Read the article

  • How to charge an iPhone on a Windows PC without Installing iTunes

    - by Martin Hollingsworth
    I want to be able to charge my iPhone on my work computer, which is running Windows Server 2008 SP1 64-Bit. When I plug the iPhone in with the USB cable, it will not charge. Windows attempts to locate a driver for the device but only comes up with a generic Camera device and even if I allow that to be installed, the iPhone still does not charge. I have checked the computer's BIOS settings and did not find anything relating to power on the USB devices. I also tried this on ports at the back of the computer in addition to those on the front. The PC is a Dell Optiplex 780. As far as I can tell USB devices do not charge unless Windows has installed an appropriate driver. Since it is a work computer I do not want to install iTunes which does include a driver. I have a workaround that I will post as an answer for reference.

    Read the article

  • What algorithms do "the big ones" use to cluster news?

    - by marco92w
    I want to cluster texts for a news website. At the moment I use this algorithm to find the related articles. But I found out that PHP's similar_text() gives very good results, too. What sort of algorithms do "the big ones", Google News, Topix, Techmeme, Wikio, Megite etc., use? Of course, you don't know exactly how the algorithms work. It's secret. But maybe someone knows approximately the way they work? The algorithm I use at the moment is very slow. It only compares two articles. So for having the relations between 5,000 articles you need about 12,500,000 comparisons. This is quite a lot. Are there alternatives to reduce the number of necessary comparisons? [I don't look for improvements for my algorithm.] What do "the big ones" do? I'm sure they don't always compare one article to another and this 12,500,000 times for 5,000 news. It would be great if somebody can say something about this topic.

    Read the article

  • setup Zyxel USG 20W as L2TP VPN Server

    - by Massimo
    I've a Zywall USG 20W (wireless disabled) behind a router supplied by the ISP. All ports (both TCP and UDP) on the ISP router are forwarded to the 20W. I'm trying to configure an L2TP VPN to be used by Windows Xp / 7 with Microsoft native client. This was working before with a different firewall, so I'm pretty sure that all the required packets are flowing to the 20W. I followed a tutorial from the italian Zyxel Website, but I cannot get the VPN to work. Always cannot pass phase 2, and I see the following on the log: [ID]: Tunnel [Default_L2TP_VPN_Connection] Phase 2 local policy mismatch Phase 1 goes fine. In Windows the error is always 788. This happens regardless the proposals I set in the phase 1 and 2 setting. What should I check ? Is there any way to get more detailed diagnostic info (policy mismatch is too generic) ? Thanks a lot to whom may help. Massimo.

    Read the article

  • Ubuntu Server - Power failure leads to boot failure

    - by Ali Nadalizadeh
    I have installed Ubuntu Server 10.04.1 LTS on an ext4 partition. Whenever my system looses power suddenly, It doesn't boot into the normal procedure to fix the problems automatically, but switches to the busy box shell (where it says Kernel Panic : No init found) So I guess kernel is refusing to mount the filesystem when it is not clean, since when I boot up using a Live CD and fsck it, it boots up correctly. How can I force kernel to mount the filesystem, even if it is not clean ?, so that automated fsck on system startup fixes the problems... (or it's a grub problem ?) K-V : 2.6.32-26-generic-pae #48-Ubuntu SMP

    Read the article

  • HP Compaq nc8230 hackintosh?

    - by David
    I have an HP Compaq nc8230 with a Pentium M (1.86GHz, SSE2) 1.5GB RAM, and an ATI Mobility Radeon x600 (64MB dedicated, 596MB shared). I'm trying to install Mac OS X Leopard on it. I have a legal copy of Leopard from apple, so I tried using the generic.iso and putting in the Leo DVD when it tells me to. It gets to the Apple logo with the spinny thing for maybe 5 minutes, but then the computer just restarts. I don't get past the apple logo. Then I tried using iDeneb 1.3 (10.5.5) but it doesn't boot into the DVD. My computer just ignores it and moves onto the hard drive. I would appreciate some help with either methods (moat prefferably the more legal one), I really need an intel Mac, my PowerBook G4 just doesn't cut it.

    Read the article

  • Force-directed graphing

    - by David
    Hello, I'm trying to write a force-directed or force-atlas code base for a graphing application I'm building for myself. Here is an example of what I'm attempting: http://sawamuland.com/flash/graph.html I managed to find some pseudo code to accomplish what I'd like on the Wiki Force-atlas article. I've converted this into ActionScript 3.0 code since it's a Flash application. Here is my source: var timestep:int = 0; var damping:int = 0; var total_kinetic_engery:int = 0; for (var node in list) { var net_force:int = 0; for (var other_node in list) { net_force += coulombRepulsion(node, other_node, nodeList); } for (var spring in list[node].relations) { net_force += hookeAttraction(node, spring, nodeList); } list[node].velocity += (timestep * net_force) * damping; list[node].position += timestep * list[node].velocity; total_kinetic_engery += list[node].mass * (list[node].velocity) ^ 2; } The problem now is finding pseudo code or a function to perform the the coulomb repulsion and hooke attraction code. I'm not exactly sure how to accomplish this. Does anyone know of a good reference I can look at...understand and implement quickly? Best.

    Read the article

  • Good book for a software developer doing part-time (Linux) system administration work

    - by Tony Meyer
    In many smaller organisations, developers often end up doing some system administration work (for obvious reasons). A lot of the time, they have great developer skills, but few system administration skills (perhaps all self-taught), and so have to learn as they go, which is fairly inefficient. Are there canonical (or simply great) books that would help in this situation? More advanced than just using a shell (presumably a developer can do that), but not aimed at someone that hopes to spend many years doing this work. Ideally, something fairly generic (although specific to a distribution would be OK), covering databases, networking, general maintenance, etc, not just one specific task. For the most part, I'm interested in shell-based work (i.e. no GUI installed), although if there's something outstanding I'm missing, please point it out. (As an analogy, replace "system administration" with C, and I'd want K&R, with C++ and I'd want Meyers' "Effective C++").

    Read the article

  • Windows with putty via USB serial cable to Linux serial port - output ok, input isn't

    - by Aharon Robbins
    I am trying to get two way serial communications going between a Windows XP system and a Linux system (RHEL 5). I have /sbin/agetty -L 9600 ttyS0 in /etc/inittab. I am using a generic USB to serial adaptor on Windows (Unitek) and a null modem cable. I have putty configured for 9600 baud, 8 bits, no parity, one stop bit, no flow control. I get the login prompt from agetty in the putty window but input does not work; I see weird characters in the putty screen. I can echo output into the device from windows and see it, but cat < /dev/ttyS0 just prints out weird characters from what I type. Any and all suggestions will be welcome. Thanks!

    Read the article

  • HTTP SSL VPN Client? (alternative to Cisco's AnyConnect VPN)

    - by Ian Boyd
    Is there any free HTTP SSL VPN clients around, one that can act as an alternative to Cisco's own HTTP SSL VPN client (called AnyConnect)? The Cisco AnyConnect client has acknowledged problems, with no forthcoming solutions. Which is why I'm hoping for an alternative. Note: I'm only talking about the HTTP SSL VPN Client, not the HTTP SSL VPN Server. (If it were up to me they wouldn't be using Cisco at all, but it's not up to me.) Note: OpenVPN is a client that talks to their servers once you sign up for their service. It's not a generic VPN client. Note: ShrewSoft VPN is a client that uses IPsec and pre-shared keys, and was a good replacement for Cisco's old client - but not the new AnyConnect SSL VPN client. Note: Windows 7's VPN client fails to negotiate when presented with an SSL VPN connection. Note: I am looking for Windows clients only.

    Read the article

  • ASP.NET resseting SessionID cookie when cookie expiration date is set

    - by Sergej Andrejev
    I have two pages: Default.aspx and WebForm1.aspx. One of these pages stores a session variable which works fine until I add code which ads expiration date to SessionID cookie. What happens is: Open default.aspx Set-Cookie ASP.NET_SessionId=14jhsdfq23jkh13jkh12k1; expires=Fri, 19-Mar-2010 07:31:47 GMT; path=/ Click on link to open WebForm1.aspx No cookies set Click on link to open Default.aspx (Cookie is reset) Set-Cookie ASP.NET_SessionId=; expires=Fri, 19-Mar-2010 07:31:47 GMT; path=/ So the question would be how should I set SessionID cookie expiration date correctly? Default.aspx.cs using System; using System.Collections.Generic; using System.Linq; using System.Web; using System.Web.UI; using System.Web.UI.WebControls; namespace WebApplication1 { public partial class _Default : System.Web.UI.Page { protected void Page_Load(object sender, EventArgs e) { lnk.Click += new EventHandler(lnk_Click); Session["t"] = Guid.NewGuid(); Response.Cookies["ASP.NET_SessionId"].Expires = DateTime.Now.AddDays(2); } void lnk_Click(object sender, EventArgs e) { Response.Redirect("WebForm1.aspx"); } } } Default.aspx <%@ Page Language="C#" AutoEventWireup="true" CodeBehind="Default.aspx.cs" Inherits="WebApplication1._Default" %> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml" > <head runat="server"> <title></title> </head> <body> <form id="form1" runat="server"> <div> <asp:LinkButton runat="server" ID="lnk" Text=">>>" /> </div> </form> </body> </html> WebForm1.aspx.cs using System; using System.Collections.Generic; using System.Linq; using System.Web; using System.Web.UI; using System.Web.UI.WebControls; namespace WebApplication1 { public partial class WebForm1 : System.Web.UI.Page { protected void Page_Load(object sender, EventArgs e) { lnk.Click += new EventHandler(lnk_Click); } void lnk_Click(object sender, EventArgs e) { Response.Redirect("Default.aspx"); } } } WebForm1.aspx <%@ Page Language="C#" AutoEventWireup="true" CodeBehind="WebForm1.aspx.cs" Inherits="WebApplication1.WebForm1" %> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml" > <head runat="server"> <title></title> </head> <body> <form id="form1" runat="server"> <div> <asp:LinkButton runat="server" ID="lnk" Text=">>>" /> </div> </form> </body> </html>

    Read the article

  • Installing MySQL without root access

    - by vinay
    I am trying to install MySQL without root permissions. I ran through the following steps: Download MySQL Community Server 5.5.8 Linux - Generic Compressed TAR Archive Unpack it, for example to: /home/martin/mysql Create a my.cnf file in your home directory. The file contents should be: [server] user=martin basedir=/home/martin/mysql datadir=/home/martin/sql_data socket=/home/martin/socket port=3666 Go to the /home/martin/mysql directory and execute: ./scripts/mysql_install_db --defaults-file=~/my.cnf --user=martin --basedir=/home/martin/mysql --datadir=/home/martin/sql_data --socket=/home/martin/socket Your MySQL server is ready. Start it with this command: ./bin/mysqld_safe --defaults-file=~/my.cnf & When I try to change the password of MySQL it gives the error: Cannot connect to mysql server through socket '/tmp/mysql.sock' How can I change this path and see whether the mysql.sock is created or not?

    Read the article

  • Revocation status of DC can't be verified

    - by DotGeorge
    A Domain Controller within my forest was working fine (as the story usually goes). Then, suddenly, I can't logon with my smart card. Instead, I'm greeted with the following message: The system could not log you on. The revocation status of the domain controller certificate used for smart card authentication could not be determined. I literally have no idea what's happened here. As an attempted quick fix, I removed the root certificate which issued the Smart Card's certificate from the CA of both the client and DC. Then imported a newly exported one from the DC in question. Same issue. I've spotted a number of related articles on Microsoft's forums and a HP support document. Each don't really shed much light as it's a generic error message apparently. Having said all of this, other smart cards (issued from other DCs) work fine. So I have no idea what's up with this one.

    Read the article

  • Django Admin: OneToOne Relation as an Inline?

    - by Jim Robert
    I am putting together the admin for a satchmo application. Satchmo uses OneToOne relations to extend the base Product model, and I'd like to edit it all on one page. It is possible to have a OneToOne relation as an Inline? If not, what is the best way to add a few fields to a given page of my admin that will eventually be saved into the OneToOne relation? for example: class Product(models.Model): name = models.CharField(max_length=100) ... class MyProduct(models.Model): product = models.OneToOne(Product) ... I tried this for my admin but it does not work, and seems to expect a Foreign Key: class ProductInline(admin.StackedInline): model = Product fields = ('name',) class MyProductAdmin(admin.ModelAdmin): inlines = (AlbumProductInline,) admin.site.register(MyProduct, MyProductAdmin) Which throws this error: <class 'satchmo.product.models.Product'> has no ForeignKey to <class 'my_app.models.MyProduct'> Is the only way to do this a Custom Form? edit: Just tried the following code to add the fields directly... also does not work: class AlbumAdmin(admin.ModelAdmin): fields = ('product__name',)

    Read the article

  • Are all bluetooth adapters the same ?

    - by ldigas
    I have a wireless bluetooth mouse which I'm not using. It used to have a bluetooth adapter with it, which I lost a long time ago ... (don't ask). Since my regular mouse just died (bad contact in cable from messing with it too much) I was thinking of buying just the new generic bluetooth adapter ? Are all those adapters the same thing ? Or can this that came with the mouse be somehow different ? Edit by ldigas: How would one find out what bluetooth standard/class/adapter one needs ? (I don't see anything useful written on the sticker on the mouse). Or to put it bluntly - will it work with this one in your opinion ?

    Read the article

  • Set up iis7.5 to deny connections outside of LAN for certain folder

    - by Darkcat Studios
    Im setting up a combined website and extranet currently, they both read from the same database on the same server as the site is hosted on. The reason being that the website is fed from the data that the staff plug into the extranet interface. it also links in to AD for authorising access to the extranet. I have the extranet in a folder within the website folder. What I want to do is only allow the extranet to be accessed from computers within our LAN, but allow the main website to be freely accessible to internet users. I have it set up as a generic web server currently, so anyone can view anything (well up to the point where the user is asked to log into the extranet of course! I have read a lot on this but nothing I read applies to, or works in IIS7.5

    Read the article

  • USB to LPT adapter?

    - by Dave
    I'm bummed out, pretty much all of our computers here lack parallel ports. I have an EETools ChipMax programming tool that has one of the old-school Centronics connectors on the back. I figured that someone must make a USB to LPT adapter. Sure enough, I found one from iogear, the GUC1284B that is a USB to Parallel Printer cable. Note the boldface on the Printer. It must connect to a printer -- it isn't some generic USB to parallel interface, unfortunately. Does anyone here know of an adapter that works for parallel devices that aren't printers? I'd hate to have to buy a USB version of the ChipMax when I don't need to use it very much.

    Read the article

  • Rails Fixtures Don't Seem to Support Transitive Associations

    - by Rick Wayne
    So I've got 3 models in my app, connected by HABTM relations: class Member < ActiveRecord::Base has_and_belongs_to_many :groups end class Group < ActiveRecord::Base has_and_belongs_to_many :software_instances end class SoftwareInstance < ActiveRecord::Base end And I have the appropriate join tables, and use foxy fixtures to load them: -- members.yml -- rick: name: Rick groups: cals -- groups.yml -- cals: name: CALS software_instances: delphi -- software_instances.yml -- delphi: name: No, this is not a joke, someone in our group is still maintaining Delphi apps... And I do a rake db:fixtures:load, and examine the tables. Yep, the join tables groups_members and groups_software_instances have appropriate IDs in, big numbers generated by hashing the fixture names. Yay! And if I run script/console, I can look at rick's groups and see that cals is in there, or cals's software_instances and delphi shows up. (Likewise delphi knows that it's in the group cals.) Yay! But if I look at rick.groups[0].software_instances...nada. []. And, oddly enough, rick.groups[0].id is something like 30 or 10, not 398398439. I've tried swapping around where the association is defined in the fixtures, e.g. -- members.yml -- rick name: rick -- groups.yml -- cals name: CALS members: rick No error, but same result. (Later: Confirmed, same behavior on MySQL. In fact I get the same thing if I take the foxification out and use ERB to directly create the join tables, so: -- license_groups_software_instances -- cals_delphi: group_id: <%= Fixtures.identify 'cals' % software_instance_id: <%= Fixtures.identify 'delphi' $ Before I chuck it all, reject foxy fixtures and all who sail in her and just hand-code IDs...anybody got a suggestion as to why this is happening? I'm currently working in Rails 2.3.2 with sqlite3, this occurs on both OS X and Ubuntu (and I think with MySQL too). TIA, my compadres.

    Read the article

< Previous Page | 121 122 123 124 125 126 127 128 129 130 131 132  | Next Page >